summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
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-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
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-29musl target needs std::mem nowPhilipp Matthias Schaefer
2016-06-29Replace wait constants with libc constantsNik Klassen
2016-06-28Auto merge of #370 - fiveop:context, r=posborneHomu
Provide accessors to sigmask of UContext.
2016-06-28Auto merge of #362 - fiveop:signal_enum, r=posborneHomu
Signal enum This is work in progress. I post this pull request as a request for discussion. I mark the lines I have doubts or ideas about. Ignore the first commit. It is the same as PR #361, which I wanted to base this change off.
2016-06-26Convert signal constants to enumeration.Philipp Matthias Schaefer
2016-06-20Auto merge of #377 - aoprisan:master, r=posborneHomu
Added lseek and seek64 I have added lseek and seek64 to unistd, the last one targeting Linux/Android only. I wasn't sure where to place the Whence enum, or if it's a nice of doing, I am quite fresh to Rust.
2016-06-13Added lseek to unistdAndrei Oprisan
llseek and lseek64 impl Whence fixed formatting awful typo when refactoring no llseek wrong test name using off64_t got rid of offset Added SeekHole/Data; formatted test; SeekCur/Set/End use libc constants
2016-06-11Provide accessors to sigmask of UContext.Philipp Matthias Schaefer
2016-06-10Add missing wait flag WUNTRACED for non-Linux systemsNik Klassen
2016-06-06Only deny warnings in testKamal Marhubi
This prevents us breaking builds under newer Rust versions with additional warnings.
2016-05-18Exclude UContext::get(),set() on musl, not available from libc.Justin Latimer
2016-05-07Auto merge of #361 - fiveop:missing_signals, r=@kamalmarhubiHomu
Add missing signals. In preparation of turning them into an enumeration.
2016-05-06Add missing signals.Philipp Matthias Schaefer
2016-05-06Use Wrapping for intended underflow of unsigned integer value.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!