From d1b2d29528b7794b41e66fc2136e395a02f8529b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:59:35 +0200 Subject: Merging upstream version 1.73.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/rustix/src/fs/abs.rs | 9 +- vendor/rustix/src/fs/at.rs | 27 +++-- vendor/rustix/src/fs/constants.rs | 6 +- vendor/rustix/src/fs/cwd.rs | 2 - vendor/rustix/src/fs/fcntl.rs | 4 +- vendor/rustix/src/fs/fcntl_apple.rs | 42 ++++++++ vendor/rustix/src/fs/fd.rs | 14 ++- vendor/rustix/src/fs/mod.rs | 34 ++++-- vendor/rustix/src/fs/mount.rs | 209 ++++++++---------------------------- 9 files changed, 156 insertions(+), 191 deletions(-) (limited to 'vendor/rustix/src/fs') 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(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(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(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(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( old_dirfd: PFd, @@ -177,6 +182,7 @@ pub fn linkat( /// [`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(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( /// [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(dirfd: Fd, path: P, flags: AtFlags) -> io::Result { @@ -296,6 +303,7 @@ pub fn statat(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( @@ -315,6 +323,7 @@ pub fn accessat( /// /// [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( dirfd: Fd, @@ -337,7 +346,7 @@ pub fn utimensat( /// /// [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( @@ -376,7 +385,7 @@ pub fn fclonefileat( /// /// [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( dirfd: Fd, @@ -399,7 +408,7 @@ pub fn mknodat( /// /// [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( 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 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 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: 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: 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: 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: 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: 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: 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: Fd) -> io::Result { /// [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: Fd) -> io::Result { /// /// [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: Fd, times: &Timestamps) -> io::Result<()> { backend::fs::syscalls::futimens(fd.as_fd(), times) @@ -224,6 +231,8 @@ pub fn futimens(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: 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: 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: 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 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 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: 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: 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: 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: 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: 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: 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: 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; -- cgit v1.2.3