summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-11-02sys: termios: Use associated constants for VMIN and VTIME on sparc64John Paul Adrian Glaubitz
2019-11-01sys: termios: Fix inverted logic for [cfg()] conditional for sparc64John Paul Adrian Glaubitz
The fix for #1149 has the logic for the [cfg()] conditional inverted so that the aliases for VMIN and VTIME are defined on targets that are not linux-sparc64.
2019-11-01Merge #1139bors[bot]
1139: Add `Users` and `Group` related functions r=asomers a=otavio This was a collaborative work between Johannes Schilling <dario@deaktualisierung.org>, Fredrick Brennan <copypaste@kittens.ph> and myself. This PR is a split-off from #864 so we merge ready parts first. Next, we work on the iterators. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Co-authored-by: Otavio Salvador <otavio@ossystems.com.br>
2019-11-01Merge #1150bors[bot]
1150: sys: termios: Define VMIN and VTIME as VEOF and VEOL on sparc64 r=asomers a=glaubitz On sparc64, glibc defines VMIN as VEOF and VTIME as VEOL for termios, so we need to inherit these alias definitions for nix-rust as well. Fixes #1149 Co-authored-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
2019-11-01sys: termios: Define VMIN and VTIME as VEOF and VEOL on sparc64John Paul Adrian Glaubitz
On sparc64, glibc defines VMIN as VEOF and VTIME as VEOL for termios, so we need to inherit these alias definitions for nix-rust as well. Fixes #1149
2019-10-30Add `Users` and `Group` related functionsOtavio Salvador
This was a collaborative work between Johannes Schilling <dario@deaktualisierung.org>, Fredrick Brennan <copypaste@kittens.ph> and myself. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2019-10-29Merge #1138bors[bot]
1138: Add Signal::as_str() to get representation as static string r=asomers a=MikailBag # Motivation Currently string representation of signal can be obtained with AsRef<str> impl. But it has downside: returned string's lifetime is bound to lifetime of signal, so &str must be converted to String. This allocation is avoidable, because as_ref() only returns static strings. To fix this problem, my PR adds Signal::as_str() method, which returns static string. Co-authored-by: Mikail Bagishov <bagishov.mikail@yandex.ru>
2019-10-29Implement Signal::as_str()Mikail Bagishov
2019-10-29Merge #1145bors[bot]
1145: Fix sys::socket::recvfrom for TCP sockets r=asomers a=asomers recvfrom(2) only returns the sender's address for protocols that provide it. Usually, that means it returns the sender's address for datagram sockets but not for stream sockets. Fixes #1144 Co-authored-by: Alan Somers <asomers@gmail.com>
2019-10-28Fix sys::socket::recvfrom for TCP socketsAlan Somers
recvfrom(2) only returns the sender's address for protocols that provide it. Usually, that means it returns the sender's address for datagram sockets but not for stream sockets. Fixes #1144
2019-10-22Merge #1141bors[bot]
1141: Fix typo in Gid::effective() docstring r=asomers a=scottschroeder - docstring now matches the actual `getegid()` call Co-authored-by: Scott Schroeder <scottschroeder@users.noreply.github.com>
2019-10-21fix documentation typo for effective gidScott Schroeder
2019-10-15Merge #1137bors[bot]
1137: Rustup minimal r=posborne a=asomers Fix CI on FreeBSD after rustup 1.20.0. Co-authored-by: Alan Somers <asomers@gmail.com>
2019-10-15Merge #1136bors[bot]
1136: Properly initialize msghdr when using musl r=posborne a=yshui Because of the use of MaybeUninit::uninit, the padding fields in msghdr, which only present on musl builds, are not initialized. Causing garbage data to be sent to the kernel. This change ensures the paddings are always zeroed. Co-authored-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-15Properly initialize msghdr when using muslYuxuan Shui
Because of the use of MaybeUninit::uninit, the padding fields in msghdr, which only present on musl builds, are not initialized. Causing garbage data to be sent to the kernel. This change ensures the paddings are always zeroed.
2019-10-15Use fetch instead of curl during CI on FreeBSDAlan Somers
2019-10-15Use rustup's minimal profile during CI on FreeBSDAlan Somers
This should fix CI on FreeBSD after Rustup 1.20.0 was released, and save time as well.
2019-10-07Merge #1133bors[bot]
1133: Implement mkfifoat r=asomers a=zmlcc This adds the `mkfifoat ` function, which is part of POSIX [https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkfifoat.html](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkfifoat.html) test cases are copied from `mkfifo` Co-authored-by: Zhang Miaolei <zmlcc@outlook.com>
2019-09-30add into CHANGELOGZhang Miaolei
2019-09-30refactored test casesZhang Miaolei
ignore mkfifoat in OSX and andriod
2019-09-30add mkfifoatZhang Miaolei
2019-09-28Merge #1121 #1130bors[bot]
1121: Fix #1093 r=asomers a=tathanhdinh Hello, This PR fixes the problem discovered in #1093. Thanks for any comment. 1130: unistd: getgrouplist: Rework code to use `reserve_double_buffer_size` r=asomers a=otavio The buffer resize logic can be simplified reusing the `reserve_double_buffer_size` method. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Co-authored-by: Ta Thanh Dinh <tathanhdinh@gmail.com> Co-authored-by: Otavio Salvador <otavio@ossystems.com.br>
2019-09-28Merge #1105bors[bot]
1105: posix_fallocate support r=asomers a=dingxiangfei2009 This PR add [`posix_fallocate`](http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html), which is available on - Linux - FreeBSD - Android - Emscripten - Fuchsia - WASI Here is a question: for some reason, `posix_fallocate` returns `EBADF` instead of `EPIPE` if a FIFO file descriptor is passed in on Linux 4.19.64. In the test `EBADF` is used for now, but I would like to know if such behaviour is expected. Co-authored-by: Ding Xiang Fei <dingxiangfei2009@gmail.com>
2019-09-25unistd: getgrouplist: Rework code to use `reserve_double_buffer_size`Otavio Salvador
The buffer resize logic can be simplified reusing the `reserve_double_buffer_size` method. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2019-09-25Merge #1129bors[bot]
1129: Getgroups reserve up to limit r=posborne a=otavio Co-authored-by: Otavio Salvador <otavio@ossystems.com.br>
2019-09-25unistd: getgroups: Resize buffer up to NGROUPS_MAXOtavio Salvador
Use `reserve_double_buffer_size` up to NGROUPS_MAX as limit. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2019-09-25unistd: getgroups: Rework variable namesOtavio Salvador
We are preparing the use of `reserve_double_buffer_size` but for this, some logic need to be reworked so we are doing some rename preparing for the next patch which adds its use. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2019-09-23fix #1093Ta Thanh Dinh
2019-09-22Merge #1127bors[bot]
1127: unistd: getcwd: Double the buffer when need, up to PATH_MAX as limit r=asomers a=otavio We now have a `reserve_double_buffer_size` method which reserves the double of buffer, up to a limit, allowing it to be reused on other methods in future. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Co-authored-by: Otavio Salvador <otavio@ossystems.com.br>
2019-09-21unistd: getcwd: Double the buffer when need, up to PATH_MAX as limitOtavio Salvador
We now have a `reserve_double_buffer_size` method which reserves the double of buffer, up to a limit, allowing it to be reused on other methods in future. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2019-09-21Merge #1126bors[bot]
1126: Relax some dependency versions r=asomers a=atouchet The minimum supported Rust version was bumped in #1108 so these restrictions are no longer necessary. Co-authored-by: Alex Touchet <alextouchet@outlook.com>
2019-09-21Merge #1124bors[bot]
1124: Where relevant, replace equality checks in assert! with assert_eq! r=asomers a=AdminXVII `assert_eq!` gives more debug info when the test fails by default than `assert!`. This should help make debugging easier. Co-authored-by: Xavier L'Heureux <xavier.lheureux@icloud.com>
2019-09-20Relax some dependency versionsAlex Touchet
2019-09-19Where relevant, replace equality checks in assert! with assert_eq!Xavier L'Heureux
`assert_eq!` gives more debug info when the test fails by default than `assert!`. This should help make debugging easier.
2019-09-20Merge #1123bors[bot]
1123: Fix travis r=asomers a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2019-09-19Fix test breakage in Seccomp mode.Alan Somers
Travis is now using Seccomp, and Docker's default Seccomp policy disables execveat (though, weirdly, not fexecve). It also prohibits any operations on AF_ALG sockets. While I'm here, replace close/dup with dup2, which is more reliable. Also, drop the fork mutex earlier. This way all of the exeve tests will run, even if one fails. https://docs.docker.com/engine/security/seccomp/
2019-09-19Require CAP_SYS_PTRACE for certain testsAlan Somers
process_vm_readv requires it, and I'm not exactly sure which other things do too.
2019-09-12use unrelease section in changelogDing Xiang Fei
2019-09-12use slices for array comparisonDing Xiang Fei
2019-09-12CHANGELOG updateDing Xiang Fei
2019-09-12better wordingDing Xiang Fei
2019-09-12posix_fallocateDing Xiang Fei
2019-09-04Merge #1120bors[bot]
1120: Fix length of abstract socket address r=asomers a=yshui NULL bytes have no special significance in an abstrace address, and the length of the address is solely decided by the length member. If the length is set to sun_path.len(), all the NULL bytes will be considered part of the address. Tests are updated accordingly. Closes #1119 Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com> Co-authored-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-09-04Fix length of abstract socket addressYuxuan Shui
NULL bytes have no special significance in an abstrace address, and the length of the address is solely decided by the length member. If the length is set to sun_path.len(), all the NULL bytes will be considered part of the address. Tests are updated accordingly. Closes #1119 Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-09-04Merge #1113bors[bot]
1113: Libc enum tryfrom r=asomers a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2019-09-04Replace Signal::from_c_int by Signal::try_fromAlan Somers
TryFrom wasn't stable when that function was written.
2019-09-04Simplify implementation of libc_enum! with vis metavariablesAlan Somers
2019-09-04Merge #1114bors[bot]
1114: Replace most instances of mem::uninitialized with mem::MaybeUninit r=asomers a=asomers Only two instances remain: * For the deprecated sys::socket::CmsgSpace::new. We should probably just remove that method. * For sys::termios::Termios::default_uninit. This will require some more thought. Co-authored-by: Alan Somers <asomers@gmail.com>
2019-09-03Skip the aio_suspend test on LinuxAlan Somers
On Travis (and only on Travis) this test crashes. It hits an internal assertion within glibc. It happens reliably with rustc 1.37.0. Ignore the test until Travis updates its images; then we'll try again. Issue #1099
2019-09-03Workaround an outdated Travis imageAlan Somers
Travis's "stable" images are stuck on Rust 1.35.0