Age | Commit message (Collapse) | Author |
|
There were multiple errors regarding Unix domain sockets:
* UnixAddr::path assumed that gethostbyname and similar functions would
include the terminating null as part of len. That is not universally
true. In fact, POSIX only guarantees that len will be at least large
enough to store the non-null-terminated path. So it could be larger or
smaller than nix was assuming. Since abstract sockets' paths are not
strings, we can't modify gethostbyname. Instead, I implemented the fix in
UnixAddr::path and UnixAddr::new. I clarified the documentation too.
* SockAddr::as_ffi_pair contained a Linuxism.
* sockaddr_storage_to_addr forgot to adjust sun_len when creating a UnixAddr
|
|
Change SigFlags into an enum.
Addresses #459.
This is a breaking change.
Should SigFlags be renamed to something more sensible?
|
|
Change KEvent to treat udata as an intptr_t instead of a uintptr_t.
This matches NetBSD's C definitions. Other operating systems define
it as void*, despite not really being a pointer, but none actually
define it as uintptr_t. Better to be right on NetBSD and wrong
everywhere else than wrong everywhere. Plus, it's what mio expects.
Please include this PR in nix 0.8.0
|
|
|
|
This matches NetBSD's C definitions. Other operating systems define
it as void*, despite not really being a pointer, but none actually
define it as uintptr_t. Better to be right on NetBSD and wrong
everywhere else than wrong everywhere. Plus, it's what mio expects.
|
|
|
|
|
|
|
|
|
|
The script checked for rustc >= 1.6.0, but the minimum supported version for
this crate is now 1.7.0
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|