Age | Commit message (Collapse) | Author |
|
|
|
Don't use it for FilterFlag, because it triggers recursion limit reached error
|
|
|
|
|
|
|
|
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.
|
|
|
|
The final version of libc's PR #379 removed a few definitions, and fixed
OpenBSD's definition of fn kevent.
|
|
|
|
|
|
|
|
|
|
|
|
Change 11aa1f34243d5bbb7d6327a6607bd9d2530f3954 to libc added kqueue-related
definitions. They are more accurate and more complete than nix's own
definitions. Use them where possible.
Also, rationalize Nix's definitions so its public API will be as similar as
possible across all OSes.
|
|
|
|
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.
|