diff options
Diffstat (limited to 'vendor/rustix/src/fs')
-rw-r--r-- | vendor/rustix/src/fs/abs.rs | 9 | ||||
-rw-r--r-- | vendor/rustix/src/fs/at.rs | 54 | ||||
-rw-r--r-- | vendor/rustix/src/fs/constants.rs | 14 | ||||
-rw-r--r-- | vendor/rustix/src/fs/fadvise.rs | 3 | ||||
-rw-r--r-- | vendor/rustix/src/fs/fcntl.rs | 16 | ||||
-rw-r--r-- | vendor/rustix/src/fs/fcopyfile.rs | 4 | ||||
-rw-r--r-- | vendor/rustix/src/fs/fd.rs | 45 | ||||
-rw-r--r-- | vendor/rustix/src/fs/file_type.rs | 4 | ||||
-rw-r--r-- | vendor/rustix/src/fs/memfd_create.rs | 3 | ||||
-rw-r--r-- | vendor/rustix/src/fs/mod.rs | 30 | ||||
-rw-r--r-- | vendor/rustix/src/fs/mount.rs | 6 | ||||
-rw-r--r-- | vendor/rustix/src/fs/raw_dir.rs | 9 | ||||
-rw-r--r-- | vendor/rustix/src/fs/statx.rs | 13 | ||||
-rw-r--r-- | vendor/rustix/src/fs/xattr.rs | 2 |
14 files changed, 110 insertions, 102 deletions
diff --git a/vendor/rustix/src/fs/abs.rs b/vendor/rustix/src/fs/abs.rs index f57bd00fe..8953f351e 100644 --- a/vendor/rustix/src/fs/abs.rs +++ b/vendor/rustix/src/fs/abs.rs @@ -1,7 +1,7 @@ //! POSIX-style filesystem functions which operate on bare paths. use crate::fd::OwnedFd; -#[cfg(not(target_os = "espidf"))] +#[cfg(not(any(target_os = "espidf", target_os = "vita")))] use crate::fs::Access; #[cfg(not(any( solarish, @@ -10,6 +10,7 @@ use crate::fs::Access; target_os = "netbsd", target_os = "nto", target_os = "redox", + target_os = "vita", target_os = "wasi", )))] use crate::fs::StatFs; @@ -129,7 +130,8 @@ fn _readlink(path: &CStr, mut buffer: Vec<u8>) -> io::Result<CString> { buffer.resize(nread, 0_u8); return Ok(CString::new(buffer).unwrap()); } - buffer.reserve(1); // use `Vec` reallocation strategy to grow capacity exponentially + // Use `Vec` reallocation strategy to grow capacity exponentially. + buffer.reserve(1); buffer.resize(buffer.capacity(), 0_u8); } } @@ -235,7 +237,7 @@ pub fn mkdir<P: path::Arg>(path: P, mode: Mode) -> io::Result<()> { /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html /// [Linux]: https://man7.org/linux/man-pages/man2/access.2.html -#[cfg(not(target_os = "espidf"))] +#[cfg(not(any(target_os = "espidf", target_os = "vita")))] #[inline] pub fn access<P: path::Arg>(path: P, access: Access) -> io::Result<()> { path.into_with_c_str(|path| backend::fs::syscalls::access(path, access)) @@ -257,6 +259,7 @@ pub fn access<P: path::Arg>(path: P, access: Access) -> io::Result<()> { target_os = "netbsd", target_os = "nto", target_os = "redox", + target_os = "vita", target_os = "wasi", )))] #[inline] diff --git a/vendor/rustix/src/fs/at.rs b/vendor/rustix/src/fs/at.rs index 0434b56ef..f40c46ce6 100644 --- a/vendor/rustix/src/fs/at.rs +++ b/vendor/rustix/src/fs/at.rs @@ -6,14 +6,18 @@ //! [`cwd`]: crate::fs::CWD use crate::fd::OwnedFd; +#[cfg(not(any(target_os = "espidf", target_os = "vita")))] +use crate::fs::Access; +#[cfg(not(target_os = "espidf"))] +use crate::fs::AtFlags; #[cfg(apple)] use crate::fs::CloneFlags; -#[cfg(not(any(apple, target_os = "espidf", target_os = "wasi")))] -use crate::fs::FileType; #[cfg(linux_kernel)] use crate::fs::RenameFlags; #[cfg(not(any(target_os = "aix", target_os = "espidf")))] use crate::fs::Stat; +#[cfg(not(any(apple, target_os = "espidf", target_os = "vita", target_os = "wasi")))] +use crate::fs::{Dev, FileType}; #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] use crate::fs::{Gid, Uid}; use crate::fs::{Mode, OFlags}; @@ -26,24 +30,19 @@ use { alloc::vec::Vec, backend::fd::BorrowedFd, }; -#[cfg(not(target_os = "espidf"))] -use { - crate::fs::{Access, AtFlags, Timestamps}, - crate::timespec::Nsecs, -}; - -pub use backend::fs::types::{Dev, RawMode}; +#[cfg(not(any(target_os = "espidf", target_os = "vita")))] +use {crate::fs::Timestamps, crate::timespec::Nsecs}; /// `UTIME_NOW` for use with [`utimensat`]. /// /// [`utimensat`]: crate::fs::utimensat -#[cfg(not(any(target_os = "espidf", target_os = "redox")))] +#[cfg(not(any(target_os = "espidf", target_os = "redox", target_os = "vita")))] pub const UTIME_NOW: Nsecs = backend::c::UTIME_NOW as Nsecs; /// `UTIME_OMIT` for use with [`utimensat`]. /// /// [`utimensat`]: crate::fs::utimensat -#[cfg(not(any(target_os = "espidf", target_os = "redox")))] +#[cfg(not(any(target_os = "espidf", target_os = "redox", target_os = "vita")))] pub const UTIME_OMIT: Nsecs = backend::c::UTIME_OMIT as Nsecs; /// `openat(dirfd, path, oflags, mode)`—Opens a file. @@ -104,8 +103,8 @@ fn _readlinkat(dirfd: BorrowedFd<'_>, path: &CStr, mut buffer: Vec<u8>) -> io::R debug_assert!(nread <= buffer.capacity()); if nread < buffer.capacity() { - // SAFETY: From the [documentation]: - // "On success, these calls return the number of bytes placed in buf." + // SAFETY: From the [documentation]: “On success, these calls + // return the number of bytes placed in buf.” // // [documentation]: https://man7.org/linux/man-pages/man2/readlinkat.2.html unsafe { @@ -113,13 +112,13 @@ fn _readlinkat(dirfd: BorrowedFd<'_>, path: &CStr, mut buffer: Vec<u8>) -> io::R } // SAFETY: - // - "readlink places the contents of the symbolic link pathname in the buffer - // buf" - // - [POSIX definition 3.271: Pathname]: "A string that is used to identify a - // file." - // - [POSIX definition 3.375: String]: "A contiguous sequence of bytes - // terminated by and including the first null byte." - // - "readlink does not append a terminating null byte to buf." + // - “readlink places the contents of the symbolic link pathname in + // the buffer buf” + // - [POSIX definition 3.271: Pathname]: “A string that is used to + // identify a file.” + // - [POSIX definition 3.375: String]: “A contiguous sequence of + // bytes terminated by and including the first null byte.” + // - “readlink does not append a terminating null byte to buf.” // // Thus, there will be no NUL bytes in the string. // @@ -130,9 +129,8 @@ fn _readlinkat(dirfd: BorrowedFd<'_>, path: &CStr, mut buffer: Vec<u8>) -> io::R } } - buffer.reserve(buffer.capacity() + 1); // use `Vec` reallocation - // strategy to grow capacity - // exponentially + // Use `Vec` reallocation strategy to grow capacity exponentially. + buffer.reserve(buffer.capacity() + 1); } } @@ -182,8 +180,8 @@ pub fn linkat<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>( /// `unlinkat(fd, path, flags)`—Unlinks a file or remove a directory. /// -/// With the [`REMOVEDIR`] flag, this removes a directory. This is in place -/// of a `rmdirat` function. +/// With the [`REMOVEDIR`] flag, this removes a directory. This is in place of +/// a `rmdirat` function. /// /// # References /// - [POSIX] @@ -314,7 +312,7 @@ pub fn statat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, flags: AtFlags) -> io: /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/faccessat.html /// [Linux]: https://man7.org/linux/man-pages/man2/faccessat.2.html -#[cfg(not(target_os = "espidf"))] +#[cfg(not(any(target_os = "espidf", target_os = "vita")))] #[inline] #[doc(alias = "faccessat")] pub fn accessat<P: path::Arg, Fd: AsFd>( @@ -334,7 +332,7 @@ pub fn accessat<P: path::Arg, Fd: AsFd>( /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimensat.html /// [Linux]: https://man7.org/linux/man-pages/man2/utimensat.2.html -#[cfg(not(target_os = "espidf"))] +#[cfg(not(any(target_os = "espidf", target_os = "vita")))] #[inline] pub fn utimensat<P: path::Arg, Fd: AsFd>( dirfd: Fd, @@ -396,7 +394,7 @@ pub fn fclonefileat<Fd: AsFd, DstFd: AsFd, P: path::Arg>( /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/mknodat.html /// [Linux]: https://man7.org/linux/man-pages/man2/mknodat.2.html -#[cfg(not(any(apple, target_os = "espidf", target_os = "wasi")))] +#[cfg(not(any(apple, target_os = "espidf", target_os = "vita", target_os = "wasi")))] #[inline] pub fn mknodat<P: path::Arg, Fd: AsFd>( dirfd: Fd, diff --git a/vendor/rustix/src/fs/constants.rs b/vendor/rustix/src/fs/constants.rs index 85889d90e..a9237af7a 100644 --- a/vendor/rustix/src/fs/constants.rs +++ b/vendor/rustix/src/fs/constants.rs @@ -3,17 +3,5 @@ use crate::backend; pub use crate::io::FdFlags; -#[cfg(not(target_os = "espidf"))] -pub use backend::fs::types::Access; -pub use backend::fs::types::{Dev, Mode, OFlags}; - -#[cfg(not(any(target_os = "espidf", target_os = "redox")))] -pub use backend::fs::types::AtFlags; - -#[cfg(apple)] -pub use backend::fs::types::{CloneFlags, CopyfileFlags}; - -#[cfg(linux_kernel)] -pub use backend::fs::types::*; - pub use crate::timespec::{Nsecs, Secs, Timespec}; +pub use backend::fs::types::*; diff --git a/vendor/rustix/src/fs/fadvise.rs b/vendor/rustix/src/fs/fadvise.rs index 5bc3a588a..a760a186a 100644 --- a/vendor/rustix/src/fs/fadvise.rs +++ b/vendor/rustix/src/fs/fadvise.rs @@ -1,7 +1,6 @@ use crate::{backend, io}; use backend::fd::AsFd; - -pub use backend::fs::types::Advice; +use backend::fs::types::Advice; /// `posix_fadvise(fd, offset, len, advice)`—Declares an expected access /// pattern for a file. diff --git a/vendor/rustix/src/fs/fcntl.rs b/vendor/rustix/src/fs/fcntl.rs index facbc9fa3..f80db849a 100644 --- a/vendor/rustix/src/fs/fcntl.rs +++ b/vendor/rustix/src/fs/fcntl.rs @@ -1,13 +1,14 @@ -//! The Unix `fcntl` function is effectively lots of different functions -//! hidden behind a single dynamic dispatch interface. In order to provide -//! a type-safe API, rustix makes them all separate functions so that they -//! can have dedicated static type signatures. +//! The Unix `fcntl` function is effectively lots of different functions hidden +//! behind a single dynamic dispatch interface. In order to provide a type-safe +//! API, rustix makes them all separate functions so that they can have +//! dedicated static type signatures. #[cfg(not(any( target_os = "emscripten", target_os = "espidf", target_os = "fuchsia", target_os = "redox", + target_os = "vita", target_os = "wasi" )))] use crate::fs::FlockOperation; @@ -64,7 +65,7 @@ pub fn fcntl_get_seals<Fd: AsFd>(fd: Fd) -> io::Result<SealFlags> { } #[cfg(any(linux_kernel, target_os = "freebsd", target_os = "fuchsia"))] -pub use backend::fs::types::SealFlags; +use backend::fs::types::SealFlags; /// `fcntl(fd, F_ADD_SEALS)` /// @@ -86,8 +87,8 @@ pub fn fcntl_add_seals<Fd: AsFd>(fd: Fd, seals: SealFlags) -> io::Result<()> { /// file should be locked. /// /// Unlike `flock`-style locks, `fcntl`-style locks are process-associated, -/// meaning that they don't guard against being acquired by two threads in -/// the same process. +/// meaning that they don't guard against being acquired by two threads in the +/// same process. /// /// # References /// - [POSIX] @@ -100,6 +101,7 @@ pub fn fcntl_add_seals<Fd: AsFd>(fd: Fd, seals: SealFlags) -> io::Result<()> { target_os = "espidf", target_os = "fuchsia", target_os = "redox", + target_os = "vita", target_os = "wasi" )))] #[inline] diff --git a/vendor/rustix/src/fs/fcopyfile.rs b/vendor/rustix/src/fs/fcopyfile.rs index d8931733f..e8f26ffdc 100644 --- a/vendor/rustix/src/fs/fcopyfile.rs +++ b/vendor/rustix/src/fs/fcopyfile.rs @@ -1,9 +1,7 @@ use crate::fs::CopyfileFlags; use crate::{backend, io}; use backend::fd::AsFd; - -/// `copyfile_state_t` -pub use backend::fs::types::copyfile_state_t; +use backend::fs::types::copyfile_state_t; /// `fcopyfile(from, to, state, flags)` /// diff --git a/vendor/rustix/src/fs/fd.rs b/vendor/rustix/src/fs/fd.rs index 94de43daa..3ef4b3826 100644 --- a/vendor/rustix/src/fs/fd.rs +++ b/vendor/rustix/src/fs/fd.rs @@ -7,10 +7,6 @@ use crate::fs::{Gid, Uid}; use crate::fs::{OFlags, SeekFrom, Timespec}; use crate::{backend, io}; use backend::fd::{AsFd, BorrowedFd}; - -#[cfg(not(any(target_os = "espidf", target_os = "wasi")))] -pub use backend::fs::types::FlockOperation; - #[cfg(not(any( netbsdlike, solarish, @@ -19,11 +15,19 @@ pub use backend::fs::types::FlockOperation; target_os = "espidf", target_os = "nto", target_os = "redox", + target_os = "vita", )))] -pub use backend::fs::types::FallocateFlags; - -pub use backend::fs::types::Stat; - +use backend::fs::types::FallocateFlags; +#[cfg(not(any( + target_os = "espidf", + target_os = "solaris", + target_os = "vita", + target_os = "wasi" +)))] +use backend::fs::types::FlockOperation; +#[cfg(linux_kernel)] +use backend::fs::types::FsWord; +use backend::fs::types::Stat; #[cfg(not(any( solarish, target_os = "espidf", @@ -31,15 +35,12 @@ pub use backend::fs::types::Stat; target_os = "netbsd", target_os = "nto", target_os = "redox", + target_os = "vita", target_os = "wasi", )))] -pub use backend::fs::types::StatFs; - +use backend::fs::types::StatFs; #[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))] -pub use backend::fs::types::{StatVfs, StatVfsMountFlags}; - -#[cfg(linux_kernel)] -pub use backend::fs::types::FsWord; +use backend::fs::types::StatVfs; /// Timestamps used by [`utimensat`] and [`futimens`]. /// @@ -107,8 +108,8 @@ pub fn tell<Fd: AsFd>(fd: Fd) -> io::Result<u64> { /// `fchmod(fd, mode)`—Sets open file or directory permissions. /// -/// This implementation does not support `O_PATH` file descriptors, even on -/// platforms where the host libc emulates it. +/// This implementation does not support [`OFlags::PATH`] file descriptors, +/// even on platforms where the host libc emulates it. /// /// # References /// - [POSIX] @@ -170,6 +171,7 @@ pub fn fstat<Fd: AsFd>(fd: Fd) -> io::Result<Stat> { target_os = "netbsd", target_os = "nto", target_os = "redox", + target_os = "vita", target_os = "wasi", )))] #[inline] @@ -205,7 +207,7 @@ pub fn fstatvfs<Fd: AsFd>(fd: Fd) -> io::Result<StatVfs> { /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html /// [Linux]: https://man7.org/linux/man-pages/man2/utimensat.2.html -#[cfg(not(target_os = "espidf"))] +#[cfg(not(any(target_os = "espidf", target_os = "vita")))] #[inline] pub fn futimens<Fd: AsFd>(fd: Fd, times: &Timestamps) -> io::Result<()> { backend::fs::syscalls::futimens(fd.as_fd(), times) @@ -234,6 +236,7 @@ pub fn futimens<Fd: AsFd>(fd: Fd, times: &Timestamps) -> io::Result<()> { target_os = "espidf", target_os = "nto", target_os = "redox", + target_os = "vita", )))] // not implemented in libc for netbsd yet #[inline] #[doc(alias = "posix_fallocate")] @@ -304,6 +307,7 @@ pub fn fsync<Fd: AsFd>(fd: Fd) -> io::Result<()> { target_os = "espidf", target_os = "haiku", target_os = "redox", + target_os = "vita", )))] #[inline] pub fn fdatasync<Fd: AsFd>(fd: Fd) -> io::Result<()> { @@ -329,7 +333,12 @@ pub fn ftruncate<Fd: AsFd>(fd: Fd, length: u64) -> io::Result<()> { /// - [Linux] /// /// [Linux]: https://man7.org/linux/man-pages/man2/flock.2.html -#[cfg(not(any(target_os = "espidf", target_os = "solaris", target_os = "wasi")))] +#[cfg(not(any( + target_os = "espidf", + target_os = "solaris", + target_os = "vita", + target_os = "wasi" +)))] #[inline] pub fn flock<Fd: AsFd>(fd: Fd, operation: FlockOperation) -> io::Result<()> { backend::fs::syscalls::flock(fd.as_fd(), operation) diff --git a/vendor/rustix/src/fs/file_type.rs b/vendor/rustix/src/fs/file_type.rs deleted file mode 100644 index cf8fc1d38..000000000 --- a/vendor/rustix/src/fs/file_type.rs +++ /dev/null @@ -1,4 +0,0 @@ -use crate::backend; - -/// `S_IF*` constants. -pub use backend::fs::types::FileType; diff --git a/vendor/rustix/src/fs/memfd_create.rs b/vendor/rustix/src/fs/memfd_create.rs index bbcbab258..83d1ff51e 100644 --- a/vendor/rustix/src/fs/memfd_create.rs +++ b/vendor/rustix/src/fs/memfd_create.rs @@ -1,7 +1,6 @@ use crate::fd::OwnedFd; use crate::{backend, io, path}; - -pub use backend::fs::types::MemfdFlags; +use backend::fs::types::MemfdFlags; /// `memfd_create(path, flags)` /// diff --git a/vendor/rustix/src/fs/mod.rs b/vendor/rustix/src/fs/mod.rs index 1ea0d1351..f6d543a98 100644 --- a/vendor/rustix/src/fs/mod.rs +++ b/vendor/rustix/src/fs/mod.rs @@ -19,6 +19,7 @@ mod dir; target_os = "espidf", target_os = "haiku", target_os = "redox", + target_os = "vita", )))] mod fadvise; pub(crate) mod fcntl; @@ -27,17 +28,17 @@ mod fcntl_apple; #[cfg(apple)] mod fcopyfile; pub(crate) mod fd; -mod file_type; #[cfg(apple)] mod getpath; #[cfg(not(target_os = "wasi"))] // WASI doesn't have get[gpu]id. mod id; -#[cfg(not(target_os = "wasi"))] +#[cfg(linux_kernel)] mod ioctl; #[cfg(not(any( target_os = "espidf", target_os = "haiku", target_os = "redox", + target_os = "vita", target_os = "wasi" )))] mod makedev; @@ -55,7 +56,12 @@ mod seek_from; mod sendfile; #[cfg(linux_kernel)] mod statx; -#[cfg(not(any(target_os = "espidf", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "espidf", + target_os = "redox", + target_os = "vita", + target_os = "wasi" +)))] mod sync; #[cfg(any(apple, linux_kernel))] mod xattr; @@ -81,30 +87,31 @@ pub use dir::{Dir, DirEntry}; target_os = "espidf", target_os = "haiku", target_os = "redox", + target_os = "vita", )))] -pub use fadvise::{fadvise, Advice}; +pub use fadvise::fadvise; pub use fcntl::*; #[cfg(apple)] pub use fcntl_apple::*; #[cfg(apple)] pub use fcopyfile::*; pub use fd::*; -pub use file_type::FileType; #[cfg(apple)] pub use getpath::getpath; #[cfg(not(target_os = "wasi"))] pub use id::*; -#[cfg(not(target_os = "wasi"))] +#[cfg(linux_kernel)] pub use ioctl::*; #[cfg(not(any( target_os = "espidf", target_os = "haiku", target_os = "redox", + target_os = "vita", target_os = "wasi" )))] pub use makedev::*; #[cfg(any(linux_kernel, target_os = "freebsd"))] -pub use memfd_create::{memfd_create, MemfdFlags}; +pub use memfd_create::memfd_create; #[cfg(linux_kernel)] #[cfg(feature = "fs")] pub use mount::*; @@ -116,8 +123,13 @@ pub use seek_from::SeekFrom; #[cfg(target_os = "linux")] pub use sendfile::sendfile; #[cfg(linux_kernel)] -pub use statx::{statx, Statx, StatxFlags, StatxTimestamp}; -#[cfg(not(any(target_os = "espidf", target_os = "redox", target_os = "wasi")))] +pub use statx::statx; +#[cfg(not(any( + target_os = "espidf", + target_os = "redox", + target_os = "vita", + target_os = "wasi" +)))] pub use sync::sync; #[cfg(any(apple, linux_kernel))] pub use xattr::*; diff --git a/vendor/rustix/src/fs/mount.rs b/vendor/rustix/src/fs/mount.rs index 0f04b7f69..bd44aaa7d 100644 --- a/vendor/rustix/src/fs/mount.rs +++ b/vendor/rustix/src/fs/mount.rs @@ -2,16 +2,16 @@ //! //! These have been moved to a new `rustix::mount` module. -#[deprecated(note = "rustix::fs::UnmountFlags` moved to `rustix::mount::UnmountFlags`.")] +#[deprecated(note = "`rustix::fs::UnmountFlags` moved to `rustix::mount::UnmountFlags`.")] #[doc(hidden)] pub use crate::mount::UnmountFlags; -#[deprecated(note = "rustix::fs::MountFlags` moved to `rustix::mount::MountFlags`.")] +#[deprecated(note = "`rustix::fs::MountFlags` moved to `rustix::mount::MountFlags`.")] #[doc(hidden)] pub use crate::mount::MountFlags; #[deprecated( - note = "rustix::fs::MountPropagationFlags` moved to `rustix::mount::MountPropagationFlags`." + note = "`rustix::fs::MountPropagationFlags` moved to `rustix::mount::MountPropagationFlags`." )] #[doc(hidden)] pub use crate::mount::MountPropagationFlags; diff --git a/vendor/rustix/src/fs/raw_dir.rs b/vendor/rustix/src/fs/raw_dir.rs index fd8aefa3a..93686b19a 100644 --- a/vendor/rustix/src/fs/raw_dir.rs +++ b/vendor/rustix/src/fs/raw_dir.rs @@ -43,10 +43,11 @@ impl<'buf, Fd: AsFd> RawDir<'buf, Fd> { /// ``` /// # use std::mem::MaybeUninit; /// # use rustix::fs::{CWD, Mode, OFlags, openat, RawDir}; + /// # use rustix::cstr; /// /// let fd = openat( /// CWD, - /// ".", + /// cstr!("."), /// OFlags::RDONLY | OFlags::DIRECTORY | OFlags::CLOEXEC, /// Mode::empty(), /// ) @@ -65,10 +66,11 @@ impl<'buf, Fd: AsFd> RawDir<'buf, Fd> { /// ``` /// # use std::mem::MaybeUninit; /// # use rustix::fs::{CWD, Mode, OFlags, openat, RawDir}; + /// # use rustix::cstr; /// /// let fd = openat( /// CWD, - /// ".", + /// cstr!("."), /// OFlags::RDONLY | OFlags::DIRECTORY | OFlags::CLOEXEC, /// Mode::empty(), /// ) @@ -92,10 +94,11 @@ impl<'buf, Fd: AsFd> RawDir<'buf, Fd> { /// # use std::mem::MaybeUninit; /// # use rustix::fs::{CWD, Mode, OFlags, openat, RawDir}; /// # use rustix::io::Errno; + /// # use rustix::cstr; /// /// let fd = openat( /// CWD, - /// ".", + /// cstr!("."), /// OFlags::RDONLY | OFlags::DIRECTORY | OFlags::CLOEXEC, /// Mode::empty(), /// ) diff --git a/vendor/rustix/src/fs/statx.rs b/vendor/rustix/src/fs/statx.rs index 1791697af..b7d6787a6 100644 --- a/vendor/rustix/src/fs/statx.rs +++ b/vendor/rustix/src/fs/statx.rs @@ -3,8 +3,7 @@ use crate::fd::AsFd; use crate::fs::AtFlags; use crate::{backend, io, path}; - -pub use backend::fs::types::{Statx, StatxFlags, StatxTimestamp}; +use backend::fs::types::{Statx, StatxFlags}; #[cfg(feature = "linux_4_11")] use backend::fs::syscalls::statx as _statx; @@ -28,8 +27,9 @@ use compat::statx as _statx; /// # use std::io; /// # use rustix::fs::{AtFlags, StatxFlags}; /// # use rustix::fd::BorrowedFd; -/// /// Try to determine if the provided path is a mount root. Will return `Ok(None)` if -/// /// the kernel is not new enough to support statx() or [`libc::STATX_ATTR_MOUNT_ROOT`]. +/// /// Try to determine if the provided path is a mount root. Will return +/// /// `Ok(None)` if the kernel is not new enough to support `statx` or +/// /// [`libc::STATX_ATTR_MOUNT_ROOT`]. /// fn is_mountpoint(root: BorrowedFd<'_>, path: &Path) -> io::Result<Option<bool>> { /// use rustix::fs::{AtFlags, StatxFlags}; /// @@ -71,8 +71,9 @@ mod compat { use backend::fs::types::{Statx, StatxFlags}; - // Linux kernel prior to 4.11 old versions of Docker don't support `statx`. - // We store the availability in a global to avoid unnecessary syscalls. + // Linux kernel prior to 4.11 and old versions of Docker don't support + // `statx`. We store the availability in a global to avoid unnecessary + // syscalls. // // 0: Unknown // 1: Not available diff --git a/vendor/rustix/src/fs/xattr.rs b/vendor/rustix/src/fs/xattr.rs index 53612f71f..d5be7a34b 100644 --- a/vendor/rustix/src/fs/xattr.rs +++ b/vendor/rustix/src/fs/xattr.rs @@ -15,7 +15,7 @@ bitflags! { /// `XATTR_REPLACE` const REPLACE = c::XATTR_REPLACE as c::c_uint; - /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags> + /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags> const _ = !0; } } |