summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/fs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /vendor/rustix/src/fs
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/src/fs')
-rw-r--r--vendor/rustix/src/fs/abs.rs9
-rw-r--r--vendor/rustix/src/fs/at.rs27
-rw-r--r--vendor/rustix/src/fs/constants.rs6
-rw-r--r--vendor/rustix/src/fs/cwd.rs2
-rw-r--r--vendor/rustix/src/fs/fcntl.rs4
-rw-r--r--vendor/rustix/src/fs/fcntl_apple.rs42
-rw-r--r--vendor/rustix/src/fs/fd.rs14
-rw-r--r--vendor/rustix/src/fs/mod.rs34
-rw-r--r--vendor/rustix/src/fs/mount.rs209
9 files changed, 156 insertions, 191 deletions
diff --git a/vendor/rustix/src/fs/abs.rs b/vendor/rustix/src/fs/abs.rs
index 83531a4e7..81e991772 100644
--- a/vendor/rustix/src/fs/abs.rs
+++ b/vendor/rustix/src/fs/abs.rs
@@ -2,17 +2,21 @@
use crate::fd::OwnedFd;
use crate::ffi::{CStr, CString};
+#[cfg(not(target_os = "espidf"))]
+use crate::fs::Access;
#[cfg(not(any(
solarish,
+ target_os = "espidf",
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
use crate::fs::StatFs;
#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
use crate::fs::StatVfs;
-use crate::fs::{Access, Mode, OFlags, Stat};
+use crate::fs::{Mode, OFlags, Stat};
use crate::path::SMALL_PATH_BUFFER_SIZE;
use crate::{backend, io, path};
use alloc::vec::Vec;
@@ -215,6 +219,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"))]
#[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))
@@ -231,8 +236,10 @@ pub fn access<P: path::Arg>(path: P, access: Access) -> io::Result<()> {
/// [Linux]: https://man7.org/linux/man-pages/man2/statfs.2.html
#[cfg(not(any(
solarish,
+ target_os = "espidf",
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
diff --git a/vendor/rustix/src/fs/at.rs b/vendor/rustix/src/fs/at.rs
index 0c99cc30a..5bd90fab5 100644
--- a/vendor/rustix/src/fs/at.rs
+++ b/vendor/rustix/src/fs/at.rs
@@ -9,31 +9,35 @@ use crate::fd::OwnedFd;
use crate::ffi::{CStr, CString};
#[cfg(apple)]
use crate::fs::CloneFlags;
-#[cfg(not(any(apple, target_os = "wasi")))]
+#[cfg(not(any(apple, target_os = "espidf", target_os = "wasi")))]
use crate::fs::FileType;
#[cfg(linux_kernel)]
use crate::fs::RenameFlags;
-use crate::fs::{Access, AtFlags, Mode, OFlags, Stat, Timestamps};
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
use crate::fs::{Gid, Uid};
+use crate::fs::{Mode, OFlags};
use crate::path::SMALL_PATH_BUFFER_SIZE;
-use crate::timespec::Nsecs;
use crate::{backend, io, path};
use alloc::vec::Vec;
use backend::fd::{AsFd, BorrowedFd};
+#[cfg(not(target_os = "espidf"))]
+use {
+ crate::fs::{Access, AtFlags, Stat, Timestamps},
+ crate::timespec::Nsecs,
+};
pub use backend::fs::types::{Dev, RawMode};
/// `UTIME_NOW` for use with [`utimensat`].
///
/// [`utimensat`]: crate::fs::utimensat
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
pub const UTIME_NOW: Nsecs = backend::c::UTIME_NOW as Nsecs;
/// `UTIME_OMIT` for use with [`utimensat`].
///
/// [`utimensat`]: crate::fs::utimensat
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
pub const UTIME_OMIT: Nsecs = backend::c::UTIME_OMIT as Nsecs;
/// `openat(dirfd, path, oflags, mode)`—Opens a file.
@@ -144,6 +148,7 @@ pub fn mkdirat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, mode: Mode) -> io::Re
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/linkat.html
/// [Linux]: https://man7.org/linux/man-pages/man2/linkat.2.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
pub fn linkat<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
old_dirfd: PFd,
@@ -177,6 +182,7 @@ pub fn linkat<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
/// [`REMOVEDIR`]: AtFlags::REMOVEDIR
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html
/// [Linux]: https://man7.org/linux/man-pages/man2/unlinkat.2.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
pub fn unlinkat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, flags: AtFlags) -> io::Result<()> {
path.into_with_c_str(|path| backend::fs::syscalls::unlinkat(dirfd.as_fd(), path, flags))
@@ -274,6 +280,7 @@ pub fn symlinkat<P: path::Arg, Q: path::Arg, Fd: AsFd>(
/// [Linux]: https://man7.org/linux/man-pages/man2/fstatat.2.html
/// [`Mode::from_raw_mode`]: crate::fs::Mode::from_raw_mode
/// [`FileType::from_raw_mode`]: crate::fs::FileType::from_raw_mode
+#[cfg(not(target_os = "espidf"))]
#[inline]
#[doc(alias = "fstatat")]
pub fn statat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, flags: AtFlags) -> io::Result<Stat> {
@@ -296,6 +303,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"))]
#[inline]
#[doc(alias = "faccessat")]
pub fn accessat<P: path::Arg, Fd: AsFd>(
@@ -315,6 +323,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"))]
#[inline]
pub fn utimensat<P: path::Arg, Fd: AsFd>(
dirfd: Fd,
@@ -337,7 +346,7 @@ pub fn utimensat<P: path::Arg, Fd: AsFd>(
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchmodat.html
/// [Linux]: https://man7.org/linux/man-pages/man2/fchmodat.2.html
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
#[doc(alias = "fchmodat")]
pub fn chmodat<P: path::Arg, Fd: AsFd>(
@@ -376,7 +385,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 = "wasi")))]
+#[cfg(not(any(apple, target_os = "espidf", target_os = "wasi")))]
#[inline]
pub fn mknodat<P: path::Arg, Fd: AsFd>(
dirfd: Fd,
@@ -399,7 +408,7 @@ pub fn mknodat<P: path::Arg, Fd: AsFd>(
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchownat.html
/// [Linux]: https://man7.org/linux/man-pages/man2/fchownat.2.html
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
#[doc(alias = "fchownat")]
pub fn chownat<P: path::Arg, Fd: AsFd>(
diff --git a/vendor/rustix/src/fs/constants.rs b/vendor/rustix/src/fs/constants.rs
index ef677aa49..85889d90e 100644
--- a/vendor/rustix/src/fs/constants.rs
+++ b/vendor/rustix/src/fs/constants.rs
@@ -3,9 +3,11 @@
use crate::backend;
pub use crate::io::FdFlags;
-pub use backend::fs::types::{Access, Dev, Mode, OFlags};
+#[cfg(not(target_os = "espidf"))]
+pub use backend::fs::types::Access;
+pub use backend::fs::types::{Dev, Mode, OFlags};
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
pub use backend::fs::types::AtFlags;
#[cfg(apple)]
diff --git a/vendor/rustix/src/fs/cwd.rs b/vendor/rustix/src/fs/cwd.rs
index 2745060a1..e66360e43 100644
--- a/vendor/rustix/src/fs/cwd.rs
+++ b/vendor/rustix/src/fs/cwd.rs
@@ -25,13 +25,11 @@ use backend::fd::{BorrowedFd, RawFd};
// SAFETY: `AT_FDCWD` is a reserved value that is never dynamically
// allocated, so it'll remain valid for the duration of `'static`.
#[doc(alias = "AT_FDCWD")]
-#[cfg(not(target_os = "haiku"))] // Haiku needs <https://github.com/rust-lang/rust/pull/112371>
pub const CWD: BorrowedFd<'static> =
unsafe { BorrowedFd::<'static>::borrow_raw(c::AT_FDCWD as RawFd) };
/// Return the value of [`CWD`].
#[deprecated(note = "Use `CWD` in place of `cwd()`.")]
-#[cfg(not(target_os = "haiku"))] // Haiku needs <https://github.com/rust-lang/rust/pull/112371>
pub const fn cwd() -> BorrowedFd<'static> {
let at_fdcwd = c::AT_FDCWD as RawFd;
diff --git a/vendor/rustix/src/fs/fcntl.rs b/vendor/rustix/src/fs/fcntl.rs
index 91816aaa2..f7f4790cb 100644
--- a/vendor/rustix/src/fs/fcntl.rs
+++ b/vendor/rustix/src/fs/fcntl.rs
@@ -5,6 +5,7 @@
#[cfg(not(any(
target_os = "emscripten",
+ target_os = "espidf",
target_os = "fuchsia",
target_os = "redox",
target_os = "wasi"
@@ -17,7 +18,7 @@ use backend::fs::types::OFlags;
// These `fcntl` functions like in the `io` module because they're not specific
// to files, directories, or memfd objects. We re-export them here in the `fs`
// module because the other the `fcntl` functions are here.
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub use crate::io::fcntl_dupfd_cloexec;
pub use crate::io::{fcntl_getfd, fcntl_setfd};
@@ -96,6 +97,7 @@ pub fn fcntl_add_seals<Fd: AsFd>(fd: Fd, seals: SealFlags) -> io::Result<()> {
/// [Linux]: https://man7.org/linux/man-pages/man2/fcntl.2.html
#[cfg(not(any(
target_os = "emscripten",
+ target_os = "espidf",
target_os = "fuchsia",
target_os = "redox",
target_os = "wasi"
diff --git a/vendor/rustix/src/fs/fcntl_apple.rs b/vendor/rustix/src/fs/fcntl_apple.rs
index 6d624ee47..a32e46d74 100644
--- a/vendor/rustix/src/fs/fcntl_apple.rs
+++ b/vendor/rustix/src/fs/fcntl_apple.rs
@@ -7,6 +7,7 @@ use backend::fd::AsFd;
/// - [Apple]
///
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html
+#[doc(alias = "F_RDADVISE")]
#[inline]
pub fn fcntl_rdadvise<Fd: AsFd>(fd: Fd, offset: u64, len: u64) -> io::Result<()> {
backend::fs::syscalls::fcntl_rdadvise(fd.as_fd(), offset, len)
@@ -18,7 +19,48 @@ pub fn fcntl_rdadvise<Fd: AsFd>(fd: Fd, offset: u64, len: u64) -> io::Result<()>
/// - [Apple]
///
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html
+#[doc(alias = "F_FULLSYNC")]
#[inline]
pub fn fcntl_fullfsync<Fd: AsFd>(fd: Fd) -> io::Result<()> {
backend::fs::syscalls::fcntl_fullfsync(fd.as_fd())
}
+
+/// `fcntl(fd, F_NOCACHE, value)`—Turn data caching off or on for a file
+/// descriptor.
+///
+/// See [this mailing list post] for additional information about the meanings
+/// of `F_NOCACHE` and `F_GLOBAL_NOCACHE`.
+///
+/// [this mailing list post]: https://lists.apple.com/archives/filesystem-dev/2007/Sep/msg00010.html
+///
+/// See also [`fcntl_global_nocache`].
+///
+/// # References
+/// - [Apple]
+///
+/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html
+#[doc(alias = "F_NOCACHE")]
+#[inline]
+pub fn fcntl_nocache<Fd: AsFd>(fd: Fd, value: bool) -> io::Result<()> {
+ backend::fs::syscalls::fcntl_nocache(fd.as_fd(), value)
+}
+
+/// `fcntl(fd, F_GLOBAL_NOCACHE, value)`—Turn data caching off or on for all
+/// file descriptors.
+///
+/// See [this mailing list post] for additional information about the meanings
+/// of `F_NOCACHE` and `F_GLOBAL_NOCACHE`.
+///
+/// [this mailing list post]: https://lists.apple.com/archives/filesystem-dev/2007/Sep/msg00010.html
+///
+/// See also [`fcntl_nocache`].
+///
+/// # References
+/// - [Apple]
+///
+/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html
+#[doc(alias = "F_GLOBAL_NOCACHE")]
+#[inline]
+pub fn fcntl_global_nocache<Fd: AsFd>(fd: Fd, value: bool) -> io::Result<()> {
+ backend::fs::syscalls::fcntl_global_nocache(fd.as_fd(), value)
+}
diff --git a/vendor/rustix/src/fs/fd.rs b/vendor/rustix/src/fs/fd.rs
index d0d50073e..43b2e57b1 100644
--- a/vendor/rustix/src/fs/fd.rs
+++ b/vendor/rustix/src/fs/fd.rs
@@ -8,7 +8,7 @@ use crate::fs::{OFlags, SeekFrom, Timespec};
use crate::{backend, io};
use backend::fd::{AsFd, BorrowedFd};
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub use backend::fs::types::FlockOperation;
#[cfg(not(any(
@@ -16,6 +16,8 @@ pub use backend::fs::types::FlockOperation;
solarish,
target_os = "aix",
target_os = "dragonfly",
+ target_os = "espidf",
+ target_os = "nto",
target_os = "redox",
)))]
pub use backend::fs::types::FallocateFlags;
@@ -24,8 +26,10 @@ pub use backend::fs::types::Stat;
#[cfg(not(any(
solarish,
+ target_os = "espidf",
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
@@ -161,8 +165,10 @@ pub fn fstat<Fd: AsFd>(fd: Fd) -> io::Result<Stat> {
/// [Linux]: https://man7.org/linux/man-pages/man2/fstatfs.2.html
#[cfg(not(any(
solarish,
+ target_os = "espidf",
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
@@ -199,6 +205,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"))]
#[inline]
pub fn futimens<Fd: AsFd>(fd: Fd, times: &Timestamps) -> io::Result<()> {
backend::fs::syscalls::futimens(fd.as_fd(), times)
@@ -224,6 +231,8 @@ pub fn futimens<Fd: AsFd>(fd: Fd, times: &Timestamps) -> io::Result<()> {
solarish,
target_os = "aix",
target_os = "dragonfly",
+ target_os = "espidf",
+ target_os = "nto",
target_os = "redox",
)))] // not implemented in libc for netbsd yet
#[inline]
@@ -292,6 +301,7 @@ pub fn fsync<Fd: AsFd>(fd: Fd) -> io::Result<()> {
#[cfg(not(any(
apple,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
target_os = "redox",
)))]
@@ -319,7 +329,7 @@ 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 = "solaris", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "solaris", 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/mod.rs b/vendor/rustix/src/fs/mod.rs
index fc2c3368b..fbfaa12c9 100644
--- a/vendor/rustix/src/fs/mod.rs
+++ b/vendor/rustix/src/fs/mod.rs
@@ -6,15 +6,17 @@ mod at;
mod constants;
#[cfg(linux_kernel)]
mod copy_file_range;
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
+#[cfg(not(target_os = "haiku"))] // Haiku needs <https://github.com/rust-lang/rust/pull/112371>
mod cwd;
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
mod dir;
#[cfg(not(any(
apple,
netbsdlike,
solarish,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
target_os = "redox",
)))]
@@ -32,11 +34,17 @@ mod getpath;
mod id;
#[cfg(not(target_os = "wasi"))]
mod ioctl;
-#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
mod makedev;
#[cfg(any(linux_kernel, target_os = "freebsd"))]
mod memfd_create;
#[cfg(linux_kernel)]
+#[cfg(feature = "fs")]
mod mount;
#[cfg(linux_kernel)]
mod openat2;
@@ -47,7 +55,7 @@ mod seek_from;
mod sendfile;
#[cfg(linux_kernel)]
mod statx;
-#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox", target_os = "wasi")))]
mod sync;
#[cfg(any(apple, linux_kernel))]
mod xattr;
@@ -60,22 +68,24 @@ pub use at::*;
pub use constants::*;
#[cfg(linux_kernel)]
pub use copy_file_range::copy_file_range;
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
+#[cfg(not(target_os = "haiku"))] // Haiku needs <https://github.com/rust-lang/rust/pull/112371>
pub use cwd::*;
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
pub use dir::{Dir, DirEntry};
#[cfg(not(any(
apple,
netbsdlike,
solarish,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
target_os = "redox",
)))]
pub use fadvise::{fadvise, Advice};
pub use fcntl::*;
#[cfg(apple)]
-pub use fcntl_apple::{fcntl_fullfsync, fcntl_rdadvise};
+pub use fcntl_apple::*;
#[cfg(apple)]
pub use fcopyfile::*;
pub use fd::*;
@@ -86,11 +96,17 @@ pub use getpath::getpath;
pub use id::*;
#[cfg(not(target_os = "wasi"))]
pub use ioctl::*;
-#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
pub use makedev::*;
#[cfg(any(linux_kernel, target_os = "freebsd"))]
pub use memfd_create::{memfd_create, MemfdFlags};
#[cfg(linux_kernel)]
+#[cfg(feature = "fs")]
pub use mount::*;
#[cfg(linux_kernel)]
pub use openat2::openat2;
@@ -101,7 +117,7 @@ pub use seek_from::SeekFrom;
pub use sendfile::sendfile;
#[cfg(linux_kernel)]
pub use statx::{statx, Statx, StatxFlags, StatxTimestamp};
-#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox", 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 1439b1f32..d1e6a8238 100644
--- a/vendor/rustix/src/fs/mount.rs
+++ b/vendor/rustix/src/fs/mount.rs
@@ -1,166 +1,45 @@
//! Linux `mount`.
-
-use crate::backend::fs::types::{
- InternalMountFlags, MountFlags, MountFlagsArg, MountPropagationFlags, UnmountFlags,
-};
-use crate::{backend, io, path};
-
-/// `mount(source, target, filesystemtype, mountflags, data)`
-///
-/// # References
-/// - [Linux]
-///
-/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
-#[inline]
-pub fn mount<Source: path::Arg, Target: path::Arg, Fs: path::Arg, Data: path::Arg>(
- source: Source,
- target: Target,
- file_system_type: Fs,
- flags: MountFlags,
- data: Data,
-) -> io::Result<()> {
- source.into_with_c_str(|source| {
- target.into_with_c_str(|target| {
- file_system_type.into_with_c_str(|file_system_type| {
- data.into_with_c_str(|data| {
- backend::fs::syscalls::mount(
- Some(source),
- target,
- Some(file_system_type),
- MountFlagsArg(flags.bits()),
- Some(data),
- )
- })
- })
- })
- })
-}
-
-/// `mount(NULL, target, NULL, MS_REMOUNT | mountflags, data)`
-///
-/// # References
-/// - [Linux]
-///
-/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
-#[inline]
-#[doc(alias = "mount")]
-pub fn remount<Target: path::Arg, Data: path::Arg>(
- target: Target,
- flags: MountFlags,
- data: Data,
-) -> io::Result<()> {
- target.into_with_c_str(|target| {
- data.into_with_c_str(|data| {
- backend::fs::syscalls::mount(
- None,
- target,
- None,
- MountFlagsArg(InternalMountFlags::REMOUNT.bits() | flags.bits()),
- Some(data),
- )
- })
- })
-}
-
-/// `mount(source, target, NULL, MS_BIND, NULL)`
-///
-/// # References
-/// - [Linux]
-///
-/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
-#[inline]
-#[doc(alias = "mount")]
-pub fn bind_mount<Source: path::Arg, Target: path::Arg>(
- source: Source,
- target: Target,
-) -> io::Result<()> {
- source.into_with_c_str(|source| {
- target.into_with_c_str(|target| {
- backend::fs::syscalls::mount(
- Some(source),
- target,
- None,
- MountFlagsArg(MountFlags::BIND.bits()),
- None,
- )
- })
- })
-}
-
-/// `mount(source, target, NULL, MS_BIND | MS_REC, NULL)`
-///
-/// # References
-/// - [Linux]
-///
-/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
-#[inline]
-#[doc(alias = "mount")]
-pub fn recursive_bind_mount<Source: path::Arg, Target: path::Arg>(
- source: Source,
- target: Target,
-) -> io::Result<()> {
- source.into_with_c_str(|source| {
- target.into_with_c_str(|target| {
- backend::fs::syscalls::mount(
- Some(source),
- target,
- None,
- MountFlagsArg(MountFlags::BIND.bits() | MountPropagationFlags::REC.bits()),
- None,
- )
- })
- })
-}
-
-/// `mount(NULL, target, NULL, mountflags, NULL)`
-///
-/// # References
-/// - [Linux]
-///
-/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
-#[inline]
-#[doc(alias = "mount")]
-pub fn change_mount<Target: path::Arg>(
- target: Target,
- flags: MountPropagationFlags,
-) -> io::Result<()> {
- target.into_with_c_str(|target| {
- backend::fs::syscalls::mount(None, target, None, MountFlagsArg(flags.bits()), None)
- })
-}
-
-/// `mount(source, target, NULL, MS_MOVE, NULL)`
-///
-/// # References
-/// - [Linux]
-///
-/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
-#[inline]
-#[doc(alias = "mount")]
-pub fn move_mount<Source: path::Arg, Target: path::Arg>(
- source: Source,
- target: Target,
-) -> io::Result<()> {
- source.into_with_c_str(|source| {
- target.into_with_c_str(|target| {
- backend::fs::syscalls::mount(
- Some(source),
- target,
- None,
- MountFlagsArg(InternalMountFlags::MOVE.bits()),
- None,
- )
- })
- })
-}
-
-/// `umount2(target, flags)`
-///
-/// # References
-/// - [Linux]
-///
-/// [Linux]: https://man7.org/linux/man-pages/man2/umount.2.html
-#[doc(alias = "umount", alias = "umount2")]
-pub fn unmount<Target: path::Arg>(target: Target, flags: UnmountFlags) -> io::Result<()> {
- target.into_with_c_str(|target| backend::fs::syscalls::unmount(target, flags))
-}
+//!
+//! These have been moved to a new `rustix::mount` module.
+
+#[deprecated(note = "rustix::fs::UnmountFlags` moved to `rustix::mount::UnmountFlags`.")]
+pub use crate::mount::UnmountFlags;
+
+#[deprecated(note = "rustix::fs::MountFlags` moved to `rustix::mount::MountFlags`.")]
+pub use crate::mount::MountFlags;
+
+#[deprecated(
+ note = "rustix::fs::MountPropagationFlags` moved to `rustix::mount::MountPropagationFlags`."
+)]
+pub use crate::mount::MountPropagationFlags;
+
+#[deprecated(note = "`rustix::fs::mount` moved to `rustix::mount::mount`.")]
+pub use crate::mount::mount;
+
+#[deprecated(note = "`rustix::fs::unmount` moved to `rustix::mount::unmount`.")]
+pub use crate::mount::unmount;
+
+#[deprecated(
+ note = "`rustix::fs::remount` is renamed and moved to `rustix::mount::mount_remount`."
+)]
+pub use crate::mount::mount_remount as remount;
+
+#[deprecated(
+ note = "`rustix::fs::bind_mount` is renamed and moved to `rustix::mount::mount_bind`."
+)]
+pub use crate::mount::mount_bind as bind_mount;
+
+#[deprecated(
+ note = "`rustix::fs::recursive_bind_mount` is renamed and moved to `rustix::mount::mount_recursive_bind`."
+)]
+pub use crate::mount::mount_recursive_bind as recursive_bind_mount;
+
+#[deprecated(
+ note = "`rustix::fs::change_mount` is renamed and moved to `rustix::mount::mount_change`."
+)]
+pub use crate::mount::mount_change as change_mount;
+
+#[deprecated(
+ note = "`rustix::fs::move_mount` is renamed and moved to `rustix::mount::mount_move`."
+)]
+pub use crate::mount::mount_move as move_mount;