Age | Commit message (Collapse) | Author |
|
Add epoll_create1
In order to get @kubo39's PR #384 forward, I cleaned up the commit history a bit and added `EpollEvent` back.
Since this module is used by mio, maybe @carllerche could comment on these changes.
|
|
|
|
|
|
Fixes #421.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
On Linux, the cmsg_len field of struct cmsghdr has type size_t, but it
has size socklen_t on POSIX-compliant operating systems. So on
POSIX-compliant 64-bit operating systems, struct cmsghdr has padding
gaps that aren't present on Linux. Most of the issues fixed by this
commit related to those gaps.
src/sys/socket/ffi.rs
Fix the type of the cmsg_data field so the struct layout will be
correct.
src/sys/socket/mod.rs
In CmsgIterator.next, only return a single file descriptor.
sendmsg(2) can only stuff a single file descriptor into each
cmsg.
In cmsg_align, fix the rounding calculation, and eliminate a
division instruction.
Add a missing cmsg_align call in ControlMessage.len
In ControlMessage.encode_into, add any necessary padding bytes
between the cmsghdr and the data.
In sendmsg, fix some len<->capacity confusion.
|
|
Rules for generic types were located above rules for specific types, so the
rules for specific types never got matched. This caused the
sys::socket::sockopt::test::can_get_listen_on_tcp_socket test to fail on
FreeBSD. The solution is to put all of the generic rules at the bottom.
|
|
|
|
|
|
This reverts commit 012c6623c9c50aca91b81e6d30800613f515f898.
|
|
|
|
|
|
|
|
|
|
|
|
Force using the constants even on x86 where they do not fit into isize (c_int)
|
|
|
|
|
|
This commit revamps to eventfd to follow nix conventions:
- drop in-crate FFI definitions
- rename EventFdFlag to EfdFlags
Additionally, it changes the initval argument to be a libc::c_uint,
matching the actual type.
|
|
Add missing wait flag WUNTRACED for non-Linux systems
My understanding is that this flag is required by POSIX, so all systems should allow for it
|
|
|
|
|
|
|
|
|
|
Add SO_ORIGINAL_DST
In Linux, the SO_ORIGINAL_DST socket option can be used to get the original destination, which can be needed if the connection is translated by a NAT, i.e. iptables. In C, this information can be obtained by ``getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, &remote, &remote_len)`` and returns a ``sockaddr_in`` struct. I've added a binding for this option.
Thanks!
|
|
|
|
Add support for converting AF_NETLINK sockaddr_nl addresses to
Sockaddr::Netlink(). This lets socket::recvmsg() work on netlink
sockets.
|
|
|
|
|
|
|
|
|
|
|
|
This commit adds a small build script to detect if we need to
`#[allow(raw_pointer_derive)]` and makes the attribute conditional.
Refs #337
|
|
Fixes #329
|
|
EPOLLEXCLUSIVE flag is available in Linux4.5.
|
|
Add context module.
The module wraps context handling related functions and structs.
|
|
This serves as an example use of the libc_bitflags macro.
|
|
The module wraps context handling related functions and structs.
|
|
Resolves #290.
|
|
This fixes an import that was missed in the upgrade from libc 0.1 series
to 0.2 series.
Refs https://github.com/nix-rust/nix/issues/298
|
|
|
|
Update signalfd
Update `signalfd` to use types and functions from `libc`.
It is a breaking change, because:
- renamed pub const `CREATE_NEW_FD` to `SIGNALFD_NEW`
- renamed pub const `SIGINFO_SIZE` to `SIGNALFD_SIGINFO_SIZE`
- removed pub const `SIGINFO_PADDING`
Fixes #307
|
|
Add support for MIPS targets
Closes #300
|
|
|
|
Refs https://github.com/nix-rust/nix/issues/264
|