summaryrefslogtreecommitdiff
path: root/src/sys
AgeCommit message (Collapse)Author
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-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-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
2016-05-06Add missing signals.Philipp Matthias Schaefer
2016-05-03Auto merge of #367 - justinlatimer:so-original-dst, r=kamalmarhubiHomu
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!
2016-05-02Add SO_ORIGINAL_DSTJustin Latimer
2016-05-01Support sockaddr_nl in sockaddr_storage_to_addr().James Peach
Add support for converting AF_NETLINK sockaddr_nl addresses to Sockaddr::Netlink(). This lets socket::recvmsg() work on netlink sockets.
2016-04-22Add SigSet::extend and SigSet::clear.Philipp Matthias Schaefer
2016-04-20Last few constantsarcnmx
2016-04-19Use constants from libcarcnmx
2016-04-18Add some missing SFlagsarcnmx
2016-04-14fixed a few clippy warningsAndre Bogus
2016-04-02Fix raw_pointer_derive warningKamal Marhubi
This commit adds a small build script to detect if we need to `#[allow(raw_pointer_derive)]` and makes the attribute conditional. Refs #337
2016-03-30socket: Respect IPv6 flowinfo and scope_id in InetAddr::from_stdKamal Marhubi
Fixes #329
2016-03-28epoll: Add EPOLLEXCLUSIVE flag.kubo39
EPOLLEXCLUSIVE flag is available in Linux4.5.
2016-03-17Auto merge of #311 - fiveop:context, r=@kamalmarhubiHomu
Add context module. The module wraps context handling related functions and structs.
2016-03-16mman: Use libc_bitflags macro for ProtFlagsKamal Marhubi
This serves as an example use of the libc_bitflags macro.
2016-03-14Add context module.Philipp Matthias Schaefer
The module wraps context handling related functions and structs.
2016-03-13Rename flags to conform to conventions.Philipp Matthias Schaefer
Resolves #290.
2016-03-12android: Fix reference to libc::ioctlKamal Marhubi
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
2016-03-11Use sigwait function from libc instead of own ffi function.Philipp Matthias Schaefer
2016-03-11Auto merge of #309 - alex-gulyas:update-signalfd, r=fiveopHomu
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
2016-03-11Auto merge of #301 - gabrielesvelto:master, r=kamalmarhubiHomu
Add support for MIPS targets Closes #300
2016-03-10update signalfd to use libc typesAlex Gulyás
2016-03-10uio: Use bindings from libc instead of our ownKamal Marhubi
Refs https://github.com/nix-rust/nix/issues/264