summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2016-10-16Attempt to fix build for non-{android,linux} platformsDavid Hou
2016-10-16wait: Support ptrace events for LinuxDavid Hou
2016-10-02Auto merge of #428 - philippkeller:mkstemp, r=fiveopHomu
Add Mkstemp (fixed for rust 1.2) I fixed @antifuchs addition of `mkstmp` in https://github.com/nix-rust/nix/pull/365 by making it compile in Rust 1.2 and adding documentation. A few remarks: - made it working with Rust 1.2 which needed `to_bytes_with_nul()`. I think the implementation is memory safe but would like to have a pair of eyes checking that - replaced Path by PathBuf so it's more in line with getcwd - I didn't move it into another module. If this still the consensus then I would like to do that but in a separate PR (probably moving all stdio methods out) - it's true that unistd doesn't need mkstmp since there is the crate tempdir and tempfile, but I'd love to see this here for completeness
2016-09-28Add debug_assert ensuring popped byte is nulPhilipp Keller
2016-09-27Remove double copy of array (to_owned() and PathBuf::from), use ↵Philipp Keller
OsString::from_vec on existing path var rather than construct string from pointer
2016-09-27move path outside closure to avoid use after free, restructed for easier ↵Philipp Keller
readability
2016-09-17Removes SIGSTKFLT when cross-compiling to MIPS.Tim Ryan
2016-09-18Auto merge of #429 - Idolf:master, r=fiveopHomu
Fixed a bug where UnixAddr::new_abstract forgot to count the null-byte.
2016-09-18Auto merge of #427 - oconnor663:pipe2, r=fiveopHomu
call pipe2 directly on Linux A first shot at fixing https://github.com/nix-rust/nix/issues/414. This approach keeps the old implementation for platforms other than `notbsd`, because `libc` only exposes `pipe2` in the `notbsd` module. I've tested this by hand on my Linux machine in a couple ways: - Create a toy program that opens a pipe and passes it to `cat`, which hags if `O_CLOEXEC` doesn't get set properly. Confirm that it doesn't hang, but that it does if I pass `0` as the flags to `libc::pipe2`. - Delete the new implementation entirely, and delete the `cfg` guards on the old implementation, and confirm that above is still true. I haven't actually tested a cross compilation build though. Is there a standard way to do that?
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-16fixing build for aarch64-unknown-linux-gnu (which expects the pointer to be ↵Philipp Keller
*mut u8 whereas x86_64 and i686 expect it to be *mut i8)
2016-09-16made it running with rust 1.2, added documentation to mkstempPhilipp Keller
2016-09-15Rename EpollEventKind to EpollFlags, according to convention.Philipp Matthias Schaefer
2016-09-15Add EpollCrateFlags bitflag type.Philipp Matthias Schaefer
2016-09-15make unsafe code more fine-grained in pipe2Jack O'Connor
2016-09-14call pipe2 directly on LinuxJack O'Connor
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-09-08Auto merge of #416 - philippkeller:master, r=posborneHomu
add unistd::getcwd and unistd::mkdir As a (late) followup of [this withdrawn PR](https://github.com/rust-lang/libc/pull/326) I have added getcwd (wrapper around `libc::getcwd`) and mkdir (wrapper around `libc::mkdir`) and added testing. A few notes: - I'm new to rust so I would appreciate some pair of eyes testing the code, plus I'm open for revision of code or general remarks about my coding style - I have run the tests both on OSX as on Linux (Ubuntu) - I've run `clippy` to see if my code is well formatted, however clippy issues many warnings about the project. I think I didn't add any more warnings - the methods in unistd are not documented so I also left out the documentation of `getcwd` and `mkdir`, although I think it'd probably be good to add some documentation, especially some example code how to use the methods - the base idea of `getcwd` is [taken from std](https://github.com/rust-lang/rust/blob/1.9.0/src/libstd/sys/unix/os.rs#L95-L119), should I mention that somewhere?
2016-09-07resolving all remarks by @posborne, fixed max line length=99, fixed rust ↵Philipp Keller
1.2.0 error in doc-test
2016-09-06rust 1.2.0 doesn't support expect, switched to proper match blockPhilipp Keller
2016-09-06added documentation for getcwd and mkdir, changed test so that it compares ↵Philipp Keller
against std::env::current_dir
2016-09-06fixed the trailing whitespacesPhilipp Keller
2016-09-06made it running with rust 1.2.0: the code for getcwd is now an exact copy of ↵Philipp Keller
the implementation in std
2016-09-05implemented mkdir, extended getcwd test to include long path namesPhilipp Keller
2016-09-02implemented getcwd (returning Result<PathBuf>, reconciling all calls to ↵Philipp Keller
expect into proper try handling), needs testing still
2016-09-01Auto merge of #392 - fiveop:less_ffi, r=@fiveopHomu
Replace ffi module by libc functions in mqueue.rs This is almost finished. I still need to check if I introduced any breaking changes by changing signatures. I would want to record this in the change log, however, for that we still need to merge #391. - [x] update change log - [x] run rustfmt on `src/mqueue.rs`
2016-08-31Run rustfmt on mqueue.rsPhilipp Matthias Schaefer
2016-08-31Replace ffi module by libc functions in mqueue.rsPhilipp Matthias Schaefer
2016-08-31Use libc in poll.rsPhilipp Matthias Schaefer
2016-08-29Replace parts of ffi module by libc functions in sched.rsPhilipp Matthias Schaefer
2016-08-27Auto merge of #407 - untitaker:fullfsync-fcntl, r=fiveopHomu
Add FcntlArg::F_FULLFSYNC https://developer.apple.com/library/ios/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fsync.2.html
2016-08-26Add FcntlArg::F_FULLFSYNCMarkus Unterwaditzer
https://developer.apple.com/library/ios/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fsync.2.html
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-08-10Fix the sethostname binding on FreeBSD and DragonflyBSDAlan Somers
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