about summary refs log tree commit diff
path: root/library/std/src/sys/fs/unix.rs
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2025-04-27 18:53:00 +0900
committerGitHub <noreply@github.com>2025-04-27 18:53:00 +0900
commitd91ffb6da5c306150e53f73a361f69837bc39851 (patch)
treeee6518c803de044596ce0e095d38bd7cab0f4a57 /library/std/src/sys/fs/unix.rs
parent89bb181106817c7828c16dc75ce5b2a367664471 (diff)
parent1b315ad92df192895fb2d1f0532270c54f6f8436 (diff)
downloadrust-d91ffb6da5c306150e53f73a361f69837bc39851.tar.gz
rust-d91ffb6da5c306150e53f73a361f69837bc39851.zip
Merge pull request #2351 from rust-lang/rustc-pull
Diffstat (limited to 'library/std/src/sys/fs/unix.rs')
-rw-r--r--library/std/src/sys/fs/unix.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/library/std/src/sys/fs/unix.rs b/library/std/src/sys/fs/unix.rs
index bc8817bac70..351a9f9413f 100644
--- a/library/std/src/sys/fs/unix.rs
+++ b/library/std/src/sys/fs/unix.rs
@@ -2137,6 +2137,12 @@ pub fn chroot(dir: &Path) -> io::Result<()> {
     Err(io::const_error!(io::ErrorKind::Unsupported, "chroot not supported by vxworks"))
 }
 
+pub fn mkfifo(path: &Path, mode: u32) -> io::Result<()> {
+    run_path_with_cstr(path, &|path| {
+        cvt(unsafe { libc::mkfifo(path.as_ptr(), mode.try_into().unwrap()) }).map(|_| ())
+    })
+}
+
 pub use remove_dir_impl::remove_dir_all;
 
 // Fallback for REDOX, ESP-ID, Horizon, Vita, Vxworks and Miri