summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-03-21cleanup: remove redundant unwrap in Dir::from_fdScott Lamb
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-04Remove accept4 on Android armAlan Somers
libc removed it in version 0.2.87. https://github.com/rust-lang/libc/pull/2079
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-20Merge branch 'master' into timerfd-file-leakAlan Somers
2021-02-16Close file descriptor on drop in TimerFdChristopher Dumoulin
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-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-07add passwords to GroupsBen Linsay
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-04Add support for when receiving packetsJustin Ossevoort
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-19unistd: Add getpeereid(3)William Woodruff
Closes #1339.
2020-12-19Add fuchsia supportAmanda Tait
Allow nix to compile on Fuchsia by conditionally avoiding libc functionality that does not exist for Fuchsia.
2020-12-15feat(sys): High-level personality(2) wrappersWilliam Woodruff
Adds a high level `Persona` bitflags enum, as well as `personality::get()` and `personality::set()` for interacting with `libc::personality()`.
2020-12-14Remove SockLevelAlan Somers
It's been unused since PR #133
2020-12-09Fix intermittency in the doc test for alarmAlan Somers
On Cirrus CI, this test would sometimes fail, probably due to pause being awoken by SIGRT_1. sigwait is a superior alternative to pause. Fixes #1354
2020-12-06Switch all builds from Travis to CirrusAlan Somers
Travis has been super-slow lately (> 6 hours per build). Cirrus is much faster: about 20 minutes. Cirrus also has slightly better test coverage, mainly because it doesn't use SECCOMP. Also, * Fix the Redox CI build. The old Travis configuration didn't actually build for Redox, so we never noticed that Redox can't be built with a stable compiler. Thanks to @coolreader18 for finding this. * Disable the udp_offload tests on cross-tested platforms. These tests are failing with ENOPROTOOPT in Cirrus-CI. I suspect it's due to a lack of support in QEMU. These tests were skipped on Travis because its kernel was too old. * Fix require_kernel_version on Cirrus-CI. Cirrus reports the Linux kernel version as 4.19.112+, which the semver crate can't handle. * Fix test_setfsuid on Cirrus. When run on Cirrus, it seems like the file in /tmp gets deleted as soon as it's closed. Probably an overzealous temporary file cleaner. Use /var/tmp, because no temporary file cleaner should run in there. * Skip mount tests on Cirrus. They fail for an unknown reason. Issue #1351 * Skip the AF_ALG tests on Cirrus-CI Issue #1352
2020-12-06Disable clock_getres on redoxNoah
2020-11-27Fix recvmmsg(2) implementationToby DiPasquale
There were two problems discovered with the `recvmmsg(2)` implementation that this changeset attempts to fix: 1. As mentioned in nix-rust/issues/1325, `recvmmsg(2)` can return fewer messages than requested, and 2. Passing the return value of `recvmmsg(2)` as the number of bytes in the messages received is incorrect. This changeset incorporates the proposed fix from nix-rust/issues/1325, as well as passing the correct value (`mmsghdr.msg_len`) for the number of bytes in a given message.
2020-11-15Suppress time_t musl "deprecation"Tamir Duberstein
See https://github.com/rust-lang/libc/issues/1848 in which this type is changing from i32 to i64; the change is being announced via this deprecation.
2020-11-15Suppress af_alg_iv "deprecation"Tamir Duberstein
See https://github.com/rust-lang/libc/issues/1501 in which this type's trait implementations are being removed; the change is being announced via this deprecation.
2020-10-18KEEPCNT/KEEPINTVL aren't available on OpenBSD.Laurence Tratt
Without this commit, nix doesn't currently compile on OpenBSD. Some keepalive settings can be set globally, but not per-socket (see e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=970550 for some digging into this). Since it seems that NetBSD and DragonflyBSD have these settings, it makes more sense to only exclude them on OpenBSD rather than include them on (pretty much every) other operating systems.
2020-10-13Add wrapper for mremapJim Newsome
2020-10-10Add support for TCP_KEEPCNT and TCP_KEEPINTVL TCP keepalive options.Yoav Steinberg
2020-10-10Merge #1303bors[bot]
1303: Renable the ScmTimestamp test on FreeBSD i386 r=posborne a=asomers The relevant bug was fixed in 11.3-RELEASE https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222039 Co-authored-by: Alan Somers <asomers@gmail.com>
2020-10-04Support vsock on Android as well as Linux.Andrew Walbran
Fix deprecation warning from libc update.
2020-10-03Renable the ScmTimestamp test on FreeBSD i386Alan Somers
The relevant bug was fixed in 11.3-RELEASE https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222039
2020-10-03Merge #1296bors[bot]
1296: DragonFlyBSD: use __errno_location now provided by the libc crate r=asomers a=cmusser Dragonfly recently (in Dfly 5.8) added an `__errno_location()` function to make it easy to access the thread-local `errno` variable. This has been exposed in rust-libc as of 0.2.77. This PR uses that functionality instead of the locally compiled C language shim, which the PR removes. One issue is backwards compatibilty. It requires 0.2.77 libc and DragonFly 5.8. Not sure how to gracefully handle older DragonFly versions, although I'm also not sure doing so is worth it. Co-authored-by: Chuck Musser <cmusser@sonic.net>
2020-10-03Merge #1300bors[bot]
1300: Add PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP support r=asomers a=voidc Closes #1249. I think @jabedude was working on this, but as there was no progress since May I went ahead and implemented it myself. I'm not completely sure about the cfg gates. Could we enable the functions for more targets? I'm also open for suggestions of better names for the new functions. Co-authored-by: Dominik Stolz <d.stolz@tum.de>
2020-10-03Merge #1293bors[bot]
1293: Mark nix::unistd::fork as unsafe. r=asomers a=vi Fix tests. No change in documentation. Resolves #1030. Don't forget to bump major version number to `0.19`. Co-authored-by: Vitaly _Vi Shukela <vi0oss@gmail.com>
2020-10-03Add PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP supportDominik Stolz
2020-09-28Added clock_gettime, clock_getres, clock_settime, clock_getcpuclockidDaniil Bondarev
2020-09-21DragonFlyBSD: use __errno_location now provided by the libc crateChuck Musser
This obviates the need for the C language shim for this variable, which this commit removes.
2020-09-20Mark nix::unistd::fork as unsafe.Vitaly _Vi Shukela
Fix tests. No change in documentation. Resolves #1030.
2020-09-13Adapt for safe-isation of some libc functions.Vitaly _Vi Shukela
(https://github.com/rust-lang/libc/pull/1870) Denied lint being overridden instead of unsafe block removed to preserve compatibility with old `libc` versions.
2020-08-22Merge branch 'master' into musl_seekAlan Somers
2020-08-22Expose SeekData and SeekHole on all Linux targetsAmanieu d'Antras
These were previously missing on musl and mips targets because of missing definitions in the libc crate.
2020-08-22Merge #1278bors[bot]
1278: Allow both &[CString] and &[&CStr] for sequence args in unistd r=asomers a=youknowone I am new to this project, so I wonder this kind of change is acceptable for the project or not. I agree taking `&[&CStr]` is the ideal way for the functions. But unfortunately, when users generate `CString`s from `&str`, they may get `&[CString]` rather than `&[&CStr]` Unlike single `CString` to `&CStr` argument, there is no easy way to convert `&[CString]` to `&[&CStr]` without creating new vector. By changing the type from `&[&CStr]` to `&[AsRef<CStr>]`, the args now can take both `&[CString]` and `&[&CStr]` without changing that much from nix. Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2020-08-22Merge #1282bors[bot]
1282: `ioctl-number.rst` moved. Update the link. r=asomers a=SolraBizna <!-- This space deliberately left blank --> Co-authored-by: Solra Bizna <solra@bizna.name>
2020-08-18Add Netlink Protocol Families to SockProtocol enumsinkingpoint
Currently the SockProtocol enum is rather scarce. This commit adds the Netlink protocols defined in netlink(7) to the SockProtocol enum allowing us to use the Nix socket library for more indepth Netlink work
2020-08-13doc typo in fchmodated neville
fchmod should be fchmodat Signed-off-by: ed neville <ed@s5h.net>