Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
This brings them in alignment with other things republished from
the OS specific nix::sys::signal::signal.
|
|
|
|
|
|
glibc defines this constant as "the total number of signals defined.
Since the signal numbers are allocated consecutively, NSIG is also one
greater than the largest defined signal number."
|
|
specific SO_PEERCRED
|
|
|
|
|
|
|
|
|
|
* Implement `Default`
* Add documentation
* Add some convenience wrappers
|
|
|
|
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 allows to specify no timeout and allows to specify any timespec
timeout.
|
|
|
|
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.
|
|
|
|
|
|
Consumers of the API may control visibility by means of a module. The
following is a useful pattern that may be used by implementors (here for
a couple of i2cdev ioctl definitions):
mod ioctl {
ioctl!(bad set_i2c_slave_address with super::I2C_SLAVE);
ioctl!(bad i2c_smbus with super::I2C_SMBUS);
}
This resolves #184.
|
|
Readability was unecessarily impaired via a myriad of attributes to
hide constants from the documentation. If these attributes are exposed
publically, including them in the documentation makes sense.
|
|
|
|
|
|
|
|
|
|
|
|
These had ior! rather than iow! previously. ior! is obviously
not correct for write operations.
|
|
if code incorporating these macros wants to publicly export the
functions they may do so by doing the following:
pub ioctl!(...);
Since the functions are unsafe, in many cases exposing the functions
publicly will not be desirable.
|
|
|
|
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>
|
|
This PR fixes the issue upstream https://github.com/rust-lang/rust/pull/26809
but no version 0.2.0 of the crate has been published as of yet.
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
This is more type-safe. Also, the old code wasn't cross-platform at all even
though it claimed to be. It wasn't even portable across architectures on
Linux.
|
|
|
|
* 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.
|
|
Fixes #165
|
|
|