summaryrefslogtreecommitdiff
path: root/src/sys
AgeCommit message (Collapse)Author
2016-11-18Fix Unix domain sockets.Alan Somers
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
2016-11-15Auto merge of #460 - chaosagent:sys_signal, r=fiveopHomu
Change SigFlags into an enum. Addresses #459. This is a breaking change. Should SigFlags be renamed to something more sensible?
2016-11-15Auto merge of #463 - asomers:kevent, r=fiveopHomu
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
2016-11-14Make signal argument to kill optionalPhilipp Matthias Schaefer
2016-11-10Change KEvent to treat udata as an intptr_t instead of a uintptr_t.Alan Somers
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.
2016-11-08Rename SigFlags to SigmaskHowDavid Hou
2016-11-06Add some tests for sys::signal.David Hou
2016-11-06Change SigFlags into an enum.David Hou
2016-11-05Use cfg_if to branch code in WaitStatus decodeDavid Hou
2016-10-31Remove `rustc-version` dependency and build scriptAlex Crichton
The script checked for rustc >= 1.6.0, but the minimum supported version for this crate is now 1.7.0
2016-10-29Update comments and CHANGELOG for PR 442Alan Somers
2016-10-29impl Send for KEventAlan Somers
2016-10-16Attempt to fix build for non-{android,linux} platformsDavid Hou
2016-10-16wait: Support ptrace events for LinuxDavid Hou
2016-10-13Merge github.com:nix-rust/nix into evfiltAlan Somers
2016-10-02Use libc_bitflags! for EventFlagAlan Somers
Don't use it for FilterFlag, because it triggers recursion limit reached error
2016-09-18struct KEvent should wrap an inner libc::kevent structureAlan Somers
2016-09-17Removes SIGSTKFLT when cross-compiling to MIPS.Tim Ryan
2016-09-17Fixed a bug where UnixAddr::new_abstract forgot to count the null-byte.Mathias Svensson
2016-09-17Auto merge of #410 - fiveop:epoll_create1, r=posborneHomu
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.
2016-09-15Rename EpollEventKind to EpollFlags, according to convention.Philipp Matthias Schaefer
2016-09-15Add EpollCrateFlags bitflag type.Philipp Matthias Schaefer
2016-09-09Add MSG_CMSG_CLOEXEC to MsgFlags on LinuxSebastian Dröge
Fixes #421.
2016-09-08Remove macos NOTE_ definitions that aren't in libcAlan Somers
2016-09-08Reconcile with libc changesAlan Somers
The final version of libc's PR #379 removed a few definitions, and fixed OpenBSD's definition of fn kevent.
2016-09-08Add property readers to EpollEventPhilipp Matthias Schaefer
2016-09-08Readd EpollEventPhilipp Matthias Schaefer
2016-09-08Use libc's declarationsHiroki Noda
2016-09-08Not to set EPOLL_CLOEXEC by default.Hiroki Noda
2016-09-08Add epoll_create1 and set EPOLL_CLOEXEC flag by default.Hiroki Noda
2016-09-02Define kqueue-related stuff in terms of libcAlan Somers
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.
2016-08-25Implement `Clone` for `FdSet` on Mac/iOSMurarth
2016-08-10Fix nix on FreeBSD amd64Alan Somers
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.
2016-08-10Fix the sockopt_impl matcher rule order.Alan Somers
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.
2016-07-18Fix NetBSD buildTobias Bucher
2016-07-14Name enum variants after the libc constantsSergey Bugaev
2016-07-14Revert "Manually match on RebootMode::*"Sergey Bugaev
This reverts commit 012c6623c9c50aca91b81e6d30800613f515f898.
2016-07-14Add some documentationSergey Bugaev
2016-07-14Switch Clone and CopySergey Bugaev
2016-07-13Manually match on RebootMode::*Sergey Bugaev
2016-07-13Use libc's declarationsSergey Bugaev
2016-07-13Stop targeting AndroidSergey Bugaev
2016-07-13Ignore the overflow for constantsSergey Bugaev
Force using the constants even on x86 where they do not fit into isize (c_int)
2016-07-13Add some basic docs for reboot::set_cad_enabled()Sergey Bugaev
2016-07-13Add the initial implementation of reboot()Sergey Bugaev
2016-07-03eventfd: Follow nix conventionsKamal Marhubi
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.
2016-07-01Auto merge of #379 - nikklassen:wait-flags, r=fiveopHomu
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
2016-06-29Replace wait constants with libc constantsNik Klassen
2016-06-26Convert signal constants to enumeration.Philipp Matthias Schaefer
2016-06-10Add missing wait flag WUNTRACED for non-Linux systemsNik Klassen