diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-04-24 08:12:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-24 08:12:57 +0200 |
| commit | 10732e14f4ee6e462170f883c79fb90acf3ddc2c (patch) | |
| tree | 20bf51cfeed98589dab5f1b6f56c3c56b65ff3a5 /library/std/src/sys/fs/unix.rs | |
| parent | cb3c5d773ce76e3fa869402db87429bed637cc54 (diff) | |
| parent | 780f95dd182b1a432159430add57e9ab7cb45dd6 (diff) | |
| download | rust-10732e14f4ee6e462170f883c79fb90acf3ddc2c.tar.gz rust-10732e14f4ee6e462170f883c79fb90acf3ddc2c.zip | |
Rollup merge of #139450 - NobodyXu:new-api/make-fifo, r=tgross35
Impl new API `std::os::unix::fs::mkfifo` under feature `unix_fifo` Tracking issue #139324
Diffstat (limited to 'library/std/src/sys/fs/unix.rs')
| -rw-r--r-- | library/std/src/sys/fs/unix.rs | 6 |
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 |
