summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-03-21cleanup: remove redundant unwrap in Dir::from_fdScott Lamb
2021-03-21Merge #1404bors[bot]
1404: Temporarily disable test_vsock on QEMU arches r=asomers a=asomers Issue #1403 Co-authored-by: Alan Somers <asomers@gmail.com>
2021-03-21Temporarily disable test_vsock on QEMU archesAlan Somers
Issue #1403
2021-03-06Merge #1395bors[bot]
1395: Allow sockaddr_ll size mismatch r=asomers a=internetionals Apparently the Linux kernel can return smaller sizes when the value in the last element of sockaddr_ll (`sll_addr`) is smaller than the declared size of that field. Co-authored-by: Justin Ossevoort <github@internetionals.nl>
2021-03-05Allow sockaddr_ll size mismatchJustin Ossevoort
Apparently the Linux kernel can return smaller sizes when the value in the last element of sockaddr_ll (`sll_addr`) is smaller than the declared size of that field.
2021-03-04Merge pull request #1398 from asomers/s390x-dupAlan Somers
Remove a duplicate stanza from .cirrus.yml
2021-03-04Remove a duplicate stanza from .cirrus.ymlAlan Somers
2021-03-04Merge pull request #1399 from asomers/accept4-androidAlan Somers
Remove accept4 on Android arm
2021-03-04Remove accept4 on Android armAlan Somers
libc removed it in version 0.2.87. https://github.com/rust-lang/libc/pull/2079
2021-02-23Merge pull request #1392 from asomers/docker_builderAlan Somers
During CI, use just 1 cpu for QEMU builds
2021-02-23During CI, use just 1 cpu for QEMU buildsAlan Somers
https://github.com/cirruslabs/cirrus-ci-docs/issues/741
2021-02-21Merge #1390bors[bot]
1390: pty: Make forkpty() unsafe r=asomers a=tavianator After the child returns from a fork() of a multi-threaded process, it is undefined behaviour to call non-async-signal-safe functions according to POSIX. Since forkpty() is implemented in terms of fork(), those restrictions should apply to it too. Fixes #1388 Co-authored-by: Tavian Barnes <tavianator@tavianator.com>
2021-02-20Merge pull request #1391 from asomers/update-depsAlan Somers
Various maintenance stuff
2021-02-20pty: Make forkpty() unsafeTavian Barnes
After the child returns from a fork() of a multi-threaded process, it is undefined behaviour to call non-async-signal-safe functions according to POSIX. Since forkpty() is implemented in terms of fork(), those restrictions should apply to it too.
2021-02-20Update rand to 0.8Alan Somers
This eliminates some duplicate dependencies
2021-02-20Update tempfile dev dependencyAlan Somers
This eliminates the need to build multiple versions of cfg-if
2021-02-20Fix a non_fmt_panic warning with Rustc 1.52.0Alan Somers
2021-02-20[skip ci] add a new CHANGELOG sectionAlan Somers
2021-02-20Merge pull request #1389 from asomers/r0.20.0Alan Somers
Prepare for release 0.20.0
2021-02-20Prepare for release 0.20.0Alan Somers
2021-02-20[skip ci] reformat CHANGELOGAlan Somers
2021-02-20Merge #1381bors[bot]
1381: Close file descriptor on drop in TimerFd r=asomers a=crdumoul This change closes the TimerFd file descriptor on drop. Note that the TimerFd will no longer be `Clone` or `Copy`. Since it has a destructor it can't be `Copy`, and if it were `Clone` you could end up trying to use a closed TimerFd, or double-closing the file descriptor. Addresses #1379. Co-authored-by: Christopher Dumoulin <cdumouli@akamai.com> Co-authored-by: Alan Somers <asomers@gmail.com>
2021-02-20Merge branch 'master' into timerfd-file-leakAlan Somers
2021-02-20Merge #1366bors[bot]
1366: x32 port r=asomers a=nabijaczleweli I played pretty loose with the statfs bit, hoping for CI to tell me if I broke something. Co-authored-by: наб <nabijaczleweli@nabijaczleweli.xyz>
2021-02-16Close file descriptor on drop in TimerFdChristopher Dumoulin
2021-02-15Log x32 fixesнаб
2021-02-15Bump caps to 0.5.1. Add x32 to CI for cross-builds and Tier 3 list in READMEнаб
2021-02-15Fix test_ptrace_syscall() on x32наб
Based on https://github.com/nix-rust/nix/issues/1384#issuecomment-774708486
2021-02-15Port statfs to x32наб
2021-02-15Port timespec to x32наб
2021-02-15Port sysinfo to x32наб
2021-02-15Port mqueue to x32наб
Test fix obtained from https://github.com/nix-rust/nix/issues/1384#issuecomment-774708486
2021-02-15Merge #1333bors[bot]
1333: Dir: Implement `IntoIterator` for `Dir` r=asomers a=wmanley This is useful to allow returning an iterator based on a directory iterator without needing a self-referential struct. Co-authored-by: William Manley <will@stb-tester.com>
2021-02-15Dir: Implement `IntoIterator` for `Dir`William Manley
This is useful to allow returning an iterator based on a directory iterator without needing a self-referential struct.
2021-02-15Merge #1387bors[bot]
1387: fix(unsafe): remove unnecessary unsafe r=asomers a=matu3ba libc 0.2.82 exposes status signals with macros generating safe functions Co-authored-by: Jan Philipp Hafer <jan.hafer@rwth-aachen.de>
2021-02-14fix(unsafe): remove unnecessary unsafeJan Philipp Hafer
closes #1380 libc 0.2.82 exposes status signals with macros generating safe functions
2021-02-14cargo formatJan Philipp Hafer
2021-02-13Merge #1382bors[bot]
1382: Don't implement Clone on Dir, SignalFd, and PtyMaster r=asomers a=asomers Since they close their file descriptors on Drop, it's almost impossible to use Clone without creating a double-close situation. Also, check for EBADF in SignalFd::drop and Dir::drop. Co-authored-by: Alan Somers <asomers@gmail.com>
2021-02-07Don't implement Clone on Dir, SignalFd, and PtyMasterAlan Somers
Since they close their file descriptors on Drop, it's almost impossible to use Clone without creating a double-close situation. Also, check for EBADF in SignalFd::drop and Dir::drop.
2021-02-07Merge #1338bors[bot]
1338: Add a passwd field to Group r=asomers a=blinsay Adds a `passwd` field to unistd::Group. The `gr_passwd` field exists on `libc::group` and wasn't exposed. I didn't see tests for `from(libc:group)` for either `User` or `Password`. Let me know if there are other tests I should add! Co-authored-by: Ben Linsay <blinsay@gmail.com>
2021-02-07add passwords to GroupsBen Linsay
2021-02-07Merge #1372bors[bot]
1372: Remove s390x exemptions from sys::statfs MAGIC constants r=asomers a=Jakob-Naucke Since rust-lang/libc is now using the correct data type on s390x (c_uint) for statfs constants, the s390x exemptions in the statfs MAGIC definitions like EXT4_SUPER_MAGIC can be removed. Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com> Co-authored-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-02-02Define *_MAGIC filesystem constants on Linux s390xJakob Naucke
Since rust-lang/libc is now using the correct data type on s390x (c_uint) for statfs constants, the s390x exemptions in the statfs MAGIC definitions like EXT4_SUPER_MAGIC can be removed. Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-01-31Merge #1344bors[bot]
1344: Add support for `SockAddr::Link` when receiving packets r=asomers a=internetionals fixes #1343 Co-authored-by: Justin Ossevoort <github@internetionals.nl>
2021-01-04Add support for when receiving packetsJustin Ossevoort
2021-01-03Merge #1368bors[bot]
1368: Fix fcntl for FreeBSD platform r=asomers a=AlexanderThaller When compiling the following code with nix `0.19.1` under FreeBSD 12.2: ``` use std::os::unix::io::AsRawFd; fn main() { let f = std::fs::File::create("/tmp/testfile").unwrap(); nix::fcntl::posix_fadvise( f.as_raw_fd(), 0, 0, nix::fcntl::PosixFadviseAdvice::POSIX_FADV_NOREUSE, ).unwrap(); } ``` I get the following error: ``` error[E0433]: failed to resolve: could not find `PosixFadviseAdvice` in `fcntl` --> src/main.rs:10:21 | 10 | nix::fcntl::PosixFadviseAdvice::POSIX_FADV_NOREUSE, | ^^^^^^^^^^^^^^^^^^ could not find `PosixFadviseAdvice` in `fcntl` error[E0425]: cannot find function `posix_fadvise` in module `nix::fcntl` --> src/main.rs:6:17 | 6 | nix::fcntl::posix_fadvise( | ^^^^^^^^^^^^^ not found in `nix::fcntl` error: aborting due to 2 previous errors ``` Checking the documentation I noticed the documentation for the FreeBSD platform was missing: https://docs.rs/nix/0.19.1/x86_64-unknown-freebsd/nix/?search=PosixFadviseAdvice Checking the code I noticed that `target_env` was used instead of `target_os`: * https://doc.rust-lang.org/reference/conditional-compilation.html#target_env * https://doc.rust-lang.org/reference/conditional-compilation.html#target_os Switching to `target_os` fixed the compilation errors. I also ran the tests with the fix and they seemed to be fine: ``` test result: ok. 68 passed; 0 failed; 14 ignored; 0 measured; 0 filtered out ``` I hope this makes sense to fix. Co-authored-by: Alexander Thaller <alexander.thaller@trivago.com>
2021-01-03Fix fcntl for FreeBSDAlexander Thaller
Need to use the right cfg option for the conditional compilation. target_os is the right option to use when targeting FreeBSD. target_env was used before which seems to be a typo.
2020-12-22Merge #1342bors[bot]
1342: feat(unistd): Add getpeereid(3) r=asomers a=woodruffw `getpeereid(3)` is not POSIX, but it's present on many BSD-derived Unices. It's also the standard mechanism on those OSes for retrieving socket peer credentials (compare `getsockopt` + `SO_PEERCRED` on Linux, which `nix` already supports). Closes #1339. Co-authored-by: William Woodruff <william@yossarian.net>
2020-12-19unistd: Add getpeereid(3)William Woodruff
Closes #1339.
2020-12-19Merge #1285bors[bot]
1285: Add fuchsia support r=asomers a=amanda-tait This change adds support for the Fuchsia operating system to the nix crate. Fuchsia developers have a use case for nix, particularly its safe interfaces to the recvmsg(2) and sendmsg(2). Adding support requires: * incrementing the libc dependency to 0.2.74 * conditionally not compiling nix functionality which depends on libc functionality that does not exist for Fuchsia Co-authored-by: Tamir Duberstein <tamird@google.com> Co-authored-by: Amanda Tait <atait@google.com>