Age | Commit message (Collapse) | Author |
|
1281: Added clock_gettime, clock_getres, clock_settime, clock_getcpuclockid r=asomers a=xonatius
Picked up #1100 and added `clock_getcpuclockid` call as well. Credits to @kevinwern for the initial version.
https://www.man7.org/linux/man-pages/man2/clock_gettime.2.html
https://www.man7.org/linux/man-pages/man3/clock_getcpuclockid.3.html
Closes #1275
Co-authored-by: Daniil Bondarev <xonatius@gmail.com>
|
|
|
|
1294: Add allow(unused_unsafe) to some functions. r=asomers a=vi
Co-authored-by: Vitaly _Vi Shukela <vi0oss@gmail.com>
|
|
(https://github.com/rust-lang/libc/pull/1870)
Denied lint being overridden instead of unsafe block removed
to preserve compatibility with old `libc` versions.
|
|
1290: use subordinate terminal device for termios calls r=asomers a=jclulow
The pseudo-terminal device handling tests in some places make
tcgetattr(3C) and tcsetattr(3C) calls using the control/manager file
descriptor rather than the subordinate terminal descriptor. This works
on some systems, but not all; others such as illumos (and presumably
Solaris) are more strict and require the termios requests be made
against the terminal descriptor only.
Co-authored-by: Joshua M. Clulow <jmc@oxide.computer>
|
|
1284: Expose SeekData and SeekHole on all Linux targets r=asomers a=Amanieu
These were previously missing on musl and mips targets because of
missing definitions in the libc crate.
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
|
|
These were previously missing on musl and mips targets because of
missing definitions in the libc crate.
|
|
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>
|
|
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>
|
|
1289: Add Netlink Protocol Families to SockProtocol enum r=asomers a=sinkingpoint
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 in-depth Netlink work.
Because of the way libc sockets work, this is a bit more annoying than it has any right to be - the Socket Family and the Socket protocol are intertwined in that a given c_int protocol can represent different things depending on the family. This means that as we add values to this enum we're going to get collisions (Indeed, I've left out a few values that collided with the existing TCP/UDP Protocols). I'm not sure how we would want to handle this going forward - maybe different Protocol enums for different Familys, with `Into<SockProtocol>` methods?
I followed the existing pattern in this file when adding these, but perhaps as this enum gets bigger, we should use the libc_enum macro for cleanliness?
Co-authored-by: sinkingpoint <colin@quirl.co.nz>
|
|
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
|
|
1291: doc typo in fchmodat r=asomers a=edneville
fchmod should be fchmodat
Signed-off-by: ed neville <ed@s5h.net>
Co-authored-by: ed neville <ed@s5h.net>
|
|
fchmod should be fchmodat
Signed-off-by: ed neville <ed@s5h.net>
|
|
The pseudo-terminal device handling tests in some places make
tcgetattr(3C) and tcsetattr(3C) calls using the control/manager file
descriptor rather than the subordinate terminal descriptor. This works
on some systems, but not all; others such as illumos (and presumably
Solaris) are more strict and require the termios requests be made
against the terminal descriptor only.
|
|
|
|
|
|
1277: Release version 0.18.0 r=asomers a=asomers
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
1270: Support nullable timeout in ppoll r=asomers a=MikailBag
Co-authored-by: Mikail Bagishov <bagishov.mikail@yandex.ru>
|
|
|
|
1276: Raise libc dependecy to 0.2.73 r=asomers a=asomers
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
1224: Update the Linux CI environment to Ubuntu Bionic r=asomers a=asomers
Co-authored-by: Alan Somers <asomers@gmail.com>
Co-authored-by: Alan Somers <asomers@axcient.com>
|
|
1261: Adding an implementation for timerfd. r=asomers a=vdagonneau-anssi
Hello,
I have encountered a situation where I needed to use timerfd in addition to other fd with nix implementation of epoll.
Here is a basic implementation of this feature, I also added some documentation and tests.
Note: currently testing works by pausing for 1-3 seconds. Obviously it is pretty bad if we want tests to run quickly but that was my best idea at the time. Feel free to suggest any other way.
Thank you!
Co-authored-by: Vincent Dagonneau <vincent.dagonneau@ssi.gouv.fr>
|
|
Removed support for timerfd on Android as it seems to have been deprecated? See https://android.googlesource.com/platform/development/+/73a5a3b/ndk/platforms/android-20/include/sys/timerfd.h or https://github.com/rust-lang/libc/issues/1589
Removed the public status of `TimerSpec`, as it should not be exposed to the user.
Implemented `FromRawFd` for `TimerFd` as it already implements `AsRawFd`.
Addressed comments from the latest code review:
- Removed upper bound assertions on timer expirations in tests.
- Made the main example runnable and added code to show how to wait for the timer.
- Refactored `ClockId` to use `libc_enum`.
- Added comments for all public parts of the module.
- Wrapped to 80 cols.
- Changed the size of the buffer in the tests to the minimum required.
* Ran rustfmt.
* Added a `From` implementation for `libc::timespec` -> `TimeSpec`.
* Reworked the example with the new changes and changed the timer from 5 to 1 second.
* Added a constructor for a 0-initialized `TimerSpec`.
* Added a new method to get the timer configured expiration (based on timerfd_gettime).
* Added an helper method to unset the expiration of the timer.
* Added a `wait` method to actually read from the timer.
* Renamed `settime` into just `set`.
* Refactored the tests and added a new one that tests both the `unset` and the `get` method.
Modified CHANGELOG.
|
|
1265: Expose IP_PKTINFO Control Message on Android and iOS r=asomers a=bltavares
The commit https://github.com/nix-rust/nix/pull/1222 added the very
useful Ipv4PktInfo to allow `sendmsg` to define the origin of the ip.
Unfortunattely, it didn't add the struct to Android target devices as
well. This commit adds the `target_os = "android"` and `target_os =" ios"` checks on the same
place to allow the compilation to work for the following archs tested:
- `cross build --target aarch64-linux-android`
- `cross build --target x86_64-linux-android`
- `cross build --target armv7-linux-androideabi`
- `cross build --target aarch64-apple-ios`
- `cross build --target x86_64-apple-ios`
Co-authored-by: Bruno Tavares <connect+github@bltavares.com>
|
|
The commit https://github.com/nix-rust/nix/pull/1222 added the very
useful Ipv4PktInfo to allow `sendmsg` to define the origin of the ip.
Unfortunattely, it didn't add the struct to Android target devices as
well. This commit adds the `target_os = "android"` checks on the same
place to allow the compilation to work for the following archs tested:
- `cross build --target aarch64-linux-android`
- `cross build --target x86_64-linux-android`
- `cross build --target armv7-linux-androideabi`
Also introduces iOS to allow using on libs for those platforms
|
|
1266: Add FsType for cgroupfs r=asomers a=KentaTada
`CGROUP_SUPER_MAGIC` and `CGROUP2_SUPER_MAGIC` are not supported currently.
Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
Co-authored-by: Kenta Tada <Kenta.Tada@sony.com>
|
|
Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
|
|
1259: implement ttyname and ttyname_r r=asomers a=doy
this fixes #1204.
i know this at least works on linux, but i'm not super sure about other platforms - happy to add conditionals if it makes sense.
Co-authored-by: Jesse Luehrs <doy@tozt.net>
|
|
|
|
1244: Clippy cleanup r=asomers a=asomers
Reported-by: Clippy
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
1264: Update the FreeBSD test image to 11.4-release r=asomers a=asomers
And temporarily disable travis targets
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
OFD lock functions don't work as expected on overlayfs, which is a type
of union file system. And OVERLAYFS_SUPER_MAGIC isn't defined on musl,
at least not yet.
|
|
|
|
|
|
|
|
1268: Drop support for powerpc64-unknown-linux-gnu r=asomers a=asomers
The build is failing due to no fault of Nix. Even rust-embedded/cross
has given up on fixing it, so there's no hope for us.
Fixes #1267
See also https://github.com/rust-embedded/cross/pull/440
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
The build is failing due to no fault of Nix. Even rust-embedded/cross
has given up on fixing it, so there's no hope for us.
Fixes #1267
See also https://github.com/rust-embedded/cross/pull/440
|
|
1263: Don't run redoxer in CI r=asomers a=asomers
It's unreliable. It frequently hangs starting the Docker image, before
Cargo gets involved. Instead, use cargo to do a cross-build for Redox.
Do it manually, since rust-embedded/cross doesn't support Redox.
https://github.com/nix-rust/nix/issues/1258
https://github.com/rust-embedded/cross/issues/427
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
|
|
It was only marked unsafe because it did a pointer cast, but that
particular pointer cast is always allowed by C.
|
|
All it does is assign a value to a thread-local int. There's nothing
unsafe about that.
|
|
It's small and `Copy`, so pass by value is more efficient. This is
technically a breaking change, but most code should compile without
changes.
|
|
|
|
|