diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:39 +0000 |
commit | 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch) | |
tree | 3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /vendor/rustix/src/thread/setns.rs | |
parent | Releasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip |
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/src/thread/setns.rs')
-rw-r--r-- | vendor/rustix/src/thread/setns.rs | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/vendor/rustix/src/thread/setns.rs b/vendor/rustix/src/thread/setns.rs index 5295bab94..81c9225e3 100644 --- a/vendor/rustix/src/thread/setns.rs +++ b/vendor/rustix/src/thread/setns.rs @@ -1,5 +1,3 @@ -#![allow(unsafe_code)] - use bitflags::bitflags; use linux_raw_sys::general::{ CLONE_FILES, CLONE_FS, CLONE_NEWCGROUP, CLONE_NEWIPC, CLONE_NEWNET, CLONE_NEWNS, CLONE_NEWPID, @@ -81,15 +79,16 @@ bitflags! { } } -/// Reassociate the calling thread with the namespace associated with link referred to by `fd`. +/// Reassociate the calling thread with the namespace associated with link +/// referred to by `fd`. /// -/// `fd` must refer to one of the magic links in a `/proc/[pid]/ns/` directory, or a bind mount -/// to such a link. +/// `fd` must refer to one of the magic links in a `/proc/[pid]/ns/` directory, +/// or a bind mount to such a link. /// /// # References -/// - [`setns`] +/// - [Linux] /// -/// [`setns`]: https://man7.org/linux/man-pages/man2/setns.2.html +/// [Linux]: https://man7.org/linux/man-pages/man2/setns.2.html pub fn move_into_link_name_space( fd: BorrowedFd, allowed_type: Option<LinkNameSpaceType>, @@ -98,15 +97,15 @@ pub fn move_into_link_name_space( syscalls::setns(fd, allowed_type).map(|_r| ()) } -/// Atomically move the calling thread into one or more of the same namespaces as the thread -/// referred to by `fd`. +/// Atomically move the calling thread into one or more of the same namespaces +/// as the thread referred to by `fd`. /// /// `fd` must refer to a thread ID. See: `pidfd_open` and `clone`. /// /// # References -/// - [`setns`] +/// - [Linux] /// -/// [`setns`]: https://man7.org/linux/man-pages/man2/setns.2.html +/// [Linux]: https://man7.org/linux/man-pages/man2/setns.2.html pub fn move_into_thread_name_spaces( fd: BorrowedFd, allowed_types: ThreadNameSpaceType, @@ -118,9 +117,9 @@ pub fn move_into_thread_name_spaces( /// context with other threads. /// /// # References -/// - [`unshare`] +/// - [Linux] /// -/// [`unshare`]: https://man7.org/linux/man-pages/man2/unshare.2.html +/// [Linux]: https://man7.org/linux/man-pages/man2/unshare.2.html pub fn unshare(flags: UnshareFlags) -> io::Result<()> { syscalls::unshare(flags) } |