Age | Commit message (Collapse) | Author |
|
|
|
|
|
Fixes #421.
|
|
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?
|
|
1.2.0 error in doc-test
|
|
|
|
against std::env::current_dir
|
|
|
|
the implementation in std
|
|
|
|
expect into proper try handling), needs testing still
|
|
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`
|
|
|
|
|
|
|
|
|
|
Add FcntlArg::F_FULLFSYNC
https://developer.apple.com/library/ios/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fsync.2.html
|
|
https://developer.apple.com/library/ios/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fsync.2.html
|
|
|
|
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
|
|
|
|
|
|
Provide accessors to sigmask of UContext.
|
|
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.
|
|
|
|
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.
|
|
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
|
|
|
|
|
|
This prevents us breaking builds under newer Rust versions with
additional warnings.
|
|
|
|
Add missing signals.
In preparation of turning them into an enumeration.
|
|
|
|
|
|
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!
|