Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
unistd: Redesign the enum returned by fork()
This changes the name of the enum returned by `fork()` to `ForkResult`,
and changes the `Parent` variant to be struct-like.
The result can be matched like
use nix::unistd::ForkResult::*;
match fork().unwrap() {
Parent { child } => { ... }
Child => { ... }
}
using the shorthand matching syntax for struct-like enum variants.
This is a breaking change.
|
|
This commit changes the name of the enum returned by `fork()` to
`ForkResult`, and changes the `Parent` variant to be struct-like.
The result can be matched like
use nix::unistd::ForkResult::*;
match fork().unwrap() {
Parent { child } => { ... }
Child => { ... }
}
using the shorthand matching syntax for struct-like enum variants.
This is a breaking change.
|
|
Fixes #329
|
|
Replace a busy loop with a call to `pause(2)`.
|
|
|
|
The mount test runner uses unprivileged user namespaces. Previously,
failure from `unshare(2)` to create the user namespace would fail the
test. This changes that to simply print an error and exit successfully.
Refs https://github.com/nix-rust/nix/pull/326
|
|
|
|
|
|
mqueue: change types to allow more cases
Part of https://github.com/nix-rust/nix/pull/270, fixed according to @kamalmarhubi's comments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fixes https://github.com/carllerche/nix-rust/issues/85
|
|
|
|
|
|
|
|
|
|
|
|
The returned length of AF_UNIX sockaddrs is significant, and generally
does not match the length of the entire structure. For filesystem
sockets, this is ignorable because the path is also NUL-terminated, but
for unbound sockets (e.g., a socketpair) or abstract-namespace
sockets (a Linux extension where the address is an arbitrary
bytestring), we need to keep track of the length.
Fixes #177. Also add a UnixAddr::new_abstract function and some better
handling of abstract-namespace socket addresses to fix #169.
|
|
|
|
|
|
|
|
The best specification for control message layout appears to be
[RFC 2292, section 4](https://tools.ietf.org/html/rfc2292#section-4),
despite this not being a wire protocol. These definitions have also been
checked against glibc 2.19 <bits/socket.h> and Linux 4.0
<linux/socket.h>, and tested on Debian 8.1 and FreeBSD 10.2 x86_64.
The API differs a bit from the cmsg(3) API for type-safety reasons (and
also because the cmsg(3) API is terrible). See test/sys/test_socket.rs
for an example.
Only supports SCM_RIGHTS at the moment.
Fixes #88.
|
|
|
|
This reverts commit 046af7d1ba82506f9bc48e62ac0584361025fc02.
|
|
|
|
The best specification for control message layout appears to be
[RFC 2292, section 4](https://tools.ietf.org/html/rfc2292#section-4),
despite this not being a wire protocol. These definitions have also been
checked against glibc 2.19 <bits/socket.h> and Linux 4.0
<linux/socket.h>, and tested on Debian 8.1 and FreeBSD 10.2 x86_64.
The API differs a bit from the cmsg(4) API for type-safety reasons (and
also because the cmsg(4) API is terrible). See test/sys/test_socket.rs
for an example.
Only supports SCM_RIGHTS at the moment.
Fixes #88.
|
|
|
|
|
|
On FreeBSD, st_rdev seems to be set to a unique value (correlated with,
but not identical to, st_ino) per file. Neither the FreeBSD nor Linux
man page makes any promises on st_rdev for regular files; useful test
coverage of st_rdev would check it on a special file.
All tests now pass on FreeBSD.
|
|
|
|
|
|
This change also adds macro usages in the tests. Nothing is asserted
but the use of the macros provides a basic compile-time check that
is otherwise missing.
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
|
|
|
|
* Fixed an unused_import error in `termios.rs` for Android.
* Fixed undefined references to `preadv` and `pwritev` for Android -
At least they don't exist from API level 3 to 21.
* Fixed the uid > 0 and gid > 0 checks in `stat`'s tests - Running the
tests by root is possible, especially when running on a rooted Android
device.
Those changes made rust-nix buildable (again) on Android. All the tests
passed as well.
|
|
|
|
* Extend the enums in WaitStatus to include all process states (signaled,
stopped, exited, continued).
* Decode status from waitpid
* Return appropate WaitStatus
* Update tests to use the new WaitStatus
* Add new tests for specific status values
|
|
|
|
|
|
On an encrypted filesystem everything acts like a symlink
$ stat baz
File: ‘baz’
Size: 0 Blocks: 16 IO Block: 4096 regular empty file
Device: 26h/38d Inode: 6835152 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ posix4e) Gid: ( 1000/ posix4e)
Access: 2015-07-10 11:11:21.846851777 -0700
Modify: 2015-07-10 11:11:21.846851777 -0700
Change: 2015-07-10 11:11:21.846851777 -0700
Birth: -
|
|
|
|
|
|
Fix the boundary condition so that we never call
Rng::gen_range(64, 64).
Helps #144
|