diff options
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | src/fcntl.rs | 1 | ||||
-rw-r--r-- | src/poll.rs | 4 | ||||
-rw-r--r-- | src/pty.rs | 4 | ||||
-rw-r--r-- | src/sys/resource.rs | 36 | ||||
-rw-r--r-- | src/sys/signal.rs | 2 | ||||
-rw-r--r-- | src/sys/statfs.rs | 4 | ||||
-rw-r--r-- | src/time.rs | 2 | ||||
-rw-r--r-- | src/unistd.rs | 6 | ||||
-rw-r--r-- | test/sys/test_ptrace.rs | 2 | ||||
-rw-r--r-- | test/sys/test_sockopt.rs | 2 | ||||
-rw-r--r-- | test/test_fcntl.rs | 1 | ||||
-rw-r--r-- | test/test_mount.rs | 2 |
13 files changed, 44 insertions, 24 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 96a1ce0e..23c5c088 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). (#[1581](https://github.com/nix-rust/nix/pull/1581)) - Added `sched_setaffinity` and `sched_getaffinity` on DragonFly. (#[1537](https://github.com/nix-rust/nix/pull/1537)) +- Added `posix_fallocate` on DragonFly. + (#[1621](https://github.com/nix-rust/nix/pull/1621)) - Added the `SO_TIMESTAMPING` support (#[1547](https://github.com/nix-rust/nix/pull/1547)) - Added getter methods to `MqAttr` struct diff --git a/src/fcntl.rs b/src/fcntl.rs index 74d9eb9c..c02a81a9 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -749,6 +749,7 @@ mod posix_fadvise { #[cfg(any( target_os = "linux", target_os = "android", + target_os = "dragonfly", target_os = "emscripten", target_os = "fuchsia", any(target_os = "wasi", target_env = "wasi"), diff --git a/src/poll.rs b/src/poll.rs index 5b181526..6d332b03 100644 --- a/src/poll.rs +++ b/src/poll.rs @@ -10,7 +10,7 @@ use crate::errno::Errno; /// [`ppoll`](fn.ppoll.html) functions to specify the events of interest /// for a specific file descriptor. /// -/// After a call to `poll` or `ppoll`, the events that occured can be +/// After a call to `poll` or `ppoll`, the events that occurred can be /// retrieved by calling [`revents()`](#method.revents) on the `PollFd`. #[repr(transparent)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] @@ -31,7 +31,7 @@ impl PollFd { } } - /// Returns the events that occured in the last call to `poll` or `ppoll`. Will only return + /// Returns the events that occurred in the last call to `poll` or `ppoll`. Will only return /// `None` if the kernel provides status flags that Nix does not know about. pub fn revents(self) -> Option<PollFlags> { PollFlags::from_bits(self.pollfd.revents) @@ -112,7 +112,7 @@ pub fn grantpt(fd: &PtyMaster) -> Result<()> { /// Open a pseudoterminal device (see /// [`posix_openpt(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_openpt.html)) /// -/// `posix_openpt()` returns a file descriptor to an existing unused pseuterminal master device. +/// `posix_openpt()` returns a file descriptor to an existing unused pseudoterminal master device. /// /// # Examples /// @@ -214,7 +214,7 @@ pub fn ptsname_r(fd: &PtyMaster) -> Result<String> { /// /// `unlockpt()` unlocks the slave pseudoterminal device corresponding to the master pseudoterminal /// referred to by `fd`. This must be called before trying to open the slave side of a -/// pseuoterminal. +/// pseudoterminal. #[inline] pub fn unlockpt(fd: &PtyMaster) -> Result<()> { if unsafe { libc::unlockpt(fd.as_raw_fd()) } < 0 { diff --git a/src/sys/resource.rs b/src/sys/resource.rs index 80473e58..7f2927b4 100644 --- a/src/sys/resource.rs +++ b/src/sys/resource.rs @@ -24,12 +24,15 @@ cfg_if! { } libc_enum! { + /// Types of process resources. + /// /// The Resource enum is platform dependent. Check different platform - /// manuals for more details. Some platform links has been provided for - /// earier reference (non-exhaustive). + /// manuals for more details. Some platform links have been provided for + /// easier reference (non-exhaustive). /// /// * [Linux](https://man7.org/linux/man-pages/man2/getrlimit.2.html) /// * [FreeBSD](https://www.freebsd.org/cgi/man.cgi?query=setrlimit) + /// * [NetBSD](https://man.netbsd.org/setrlimit.2) // linux-gnu uses u_int as resource enum, which is implemented in libc as // well. @@ -49,11 +52,7 @@ libc_enum! { ), repr(i32))] #[non_exhaustive] pub enum Resource { - #[cfg(not(any( - target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd" - )))] + #[cfg(not(any(target_os = "freebsd", target_os = "netbsd", target_os = "openbsd")))] #[cfg_attr(docsrs, doc(cfg(all())))] /// The maximum amount (in bytes) of virtual memory the process is /// allowed to map. @@ -83,7 +82,13 @@ libc_enum! { /// this process may establish. RLIMIT_LOCKS, - #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "openbsd", target_os = "linux"))] + #[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "linux", + target_os = "netbsd" + ))] #[cfg_attr(docsrs, doc(cfg(all())))] /// The maximum size (in bytes) which a process may lock into memory /// using the mlock(2) system call. @@ -101,7 +106,13 @@ libc_enum! { /// setpriority or nice. RLIMIT_NICE, - #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "openbsd", target_os = "linux"))] + #[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd", + target_os = "linux", + ))] #[cfg_attr(docsrs, doc(cfg(all())))] /// The maximum number of simultaneous processes for this user id. RLIMIT_NPROC, @@ -112,7 +123,12 @@ libc_enum! { /// create. RLIMIT_NPTS, - #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "openbsd", target_os = "linux"))] + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd", + target_os = "linux", + ))] #[cfg_attr(docsrs, doc(cfg(all())))] /// When there is memory pressure and swap is available, prioritize /// eviction of a process' resident pages beyond this amount (in bytes). diff --git a/src/sys/signal.rs b/src/sys/signal.rs index f85bf266..b655604d 100644 --- a/src/sys/signal.rs +++ b/src/sys/signal.rs @@ -866,7 +866,7 @@ pub fn pthread_sigmask(how: SigmaskHow, /// Examine and change blocked signals. /// -/// For more informations see the [`sigprocmask` man +/// For more information see the [`sigprocmask` man /// pages](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigprocmask.html). pub fn sigprocmask(how: SigmaskHow, set: Option<&SigSet>, oldset: Option<&mut SigSet>) -> Result<()> { if set.is_none() && oldset.is_none() { diff --git a/src/sys/statfs.rs b/src/sys/statfs.rs index bfb94f48..62273475 100644 --- a/src/sys/statfs.rs +++ b/src/sys/statfs.rs @@ -536,7 +536,7 @@ impl Debug for Statfs { /// Describes a mounted file system. /// -/// The result is OS-dependent. For a portabable alternative, see +/// The result is OS-dependent. For a portable alternative, see /// [`statvfs`](crate::sys::statvfs::statvfs). /// /// # Arguments @@ -552,7 +552,7 @@ pub fn statfs<P: ?Sized + NixPath>(path: &P) -> Result<Statfs> { /// Describes a mounted file system. /// -/// The result is OS-dependent. For a portabable alternative, see +/// The result is OS-dependent. For a portable alternative, see /// [`fstatvfs`](crate::sys::statvfs::fstatvfs). /// /// # Arguments diff --git a/src/time.rs b/src/time.rs index 959769f4..01a8fd00 100644 --- a/src/time.rs +++ b/src/time.rs @@ -14,7 +14,7 @@ use std::mem::MaybeUninit; /// Clock identifier /// -/// Newtype pattern around `clockid_t` (which is just alias). It pervents bugs caused by +/// Newtype pattern around `clockid_t` (which is just alias). It prevents bugs caused by /// accidentally passing wrong value. #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] pub struct ClockId(clockid_t); diff --git a/src/unistd.rs b/src/unistd.rs index 01f35215..7aa1cffe 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -204,8 +204,8 @@ impl ForkResult { /// Create a new child process duplicating the parent process ([see /// fork(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fork.html)). /// -/// After calling the fork system call (successfully) two processes will -/// be created that are identical with the exception of their pid and the +/// After successfully calling the fork system call, a second process will +/// be created which is identical to the original except for the pid and the /// return value of this function. As an example: /// /// ``` @@ -225,7 +225,7 @@ impl ForkResult { /// } /// ``` /// -/// This will print something like the following (order indeterministic). The +/// This will print something like the following (order nondeterministic). The /// thing to note is that you end up with two processes continuing execution /// immediately after the fork call but with different match arms. /// diff --git a/test/sys/test_ptrace.rs b/test/sys/test_ptrace.rs index 83fff9a5..89c4e2dd 100644 --- a/test/sys/test_ptrace.rs +++ b/test/sys/test_ptrace.rs @@ -72,7 +72,7 @@ fn test_ptrace_cont() { let _m = crate::FORK_MTX.lock(); // FIXME: qemu-user doesn't implement ptrace on all architectures - // and retunrs ENOSYS in this case. + // and returns ENOSYS in this case. // We (ab)use this behavior to detect the affected platforms // and skip the test then. // On valid platforms the ptrace call should return Errno::EPERM, this diff --git a/test/sys/test_sockopt.rs b/test/sys/test_sockopt.rs index 01920fd4..59b97c8b 100644 --- a/test/sys/test_sockopt.rs +++ b/test/sys/test_sockopt.rs @@ -122,7 +122,7 @@ fn test_so_tcp_maxseg() { } // The CI doesn't supported getsockopt and setsockopt on emulated processors. -// It's beleived that a QEMU issue, the tests run ok on a fully emulated system. +// It's believed that a QEMU issue, the tests run ok on a fully emulated system. // Current CI just run the binary with QEMU but the Kernel remains the same as the host. // So the syscall doesn't work properly unless the kernel is also emulated. #[test] diff --git a/test/test_fcntl.rs b/test/test_fcntl.rs index db2acfbf..b24a49ee 100644 --- a/test/test_fcntl.rs +++ b/test/test_fcntl.rs @@ -488,6 +488,7 @@ mod test_posix_fadvise { #[cfg(any(target_os = "linux", target_os = "android", + target_os = "dragonfly", target_os = "emscripten", target_os = "fuchsia", any(target_os = "wasi", target_env = "wasi"), diff --git a/test/test_mount.rs b/test/test_mount.rs index 44287f97..1ddfcfe9 100644 --- a/test/test_mount.rs +++ b/test/test_mount.rs @@ -1,6 +1,6 @@ mod common; -// Impelmentation note: to allow unprivileged users to run it, this test makes +// Implementation note: to allow unprivileged users to run it, this test makes // use of user and mount namespaces. On systems that allow unprivileged user // namespaces (Linux >= 3.8 compiled with CONFIG_USER_NS), the test should run // without root. |