Skip to content

Commit a8c68d2

Browse files
authored
Add a mkfifoat function (#1399)
1 parent 7e90ae2 commit a8c68d2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/fs/at.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,24 @@ pub fn mknodat<P: path::Arg, Fd: AsFd>(
469469
})
470470
}
471471

472+
/// `mkfifoat(dirfd, path, mode)`—Make a FIFO special file.
473+
///
474+
/// # References
475+
/// - [POSIX]
476+
///
477+
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/mkfifoat.html
478+
#[cfg(not(any(
479+
apple,
480+
target_os = "espidf",
481+
target_os = "horizon",
482+
target_os = "vita",
483+
target_os = "wasi"
484+
)))]
485+
#[inline]
486+
pub fn mkfifoat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, mode: Mode) -> io::Result<()> {
487+
mknodat(dirfd, path, FileType::Fifo, mode, 0)
488+
}
489+
472490
/// `fchownat(dirfd, path, owner, group, flags)`—Sets file or directory
473491
/// ownership.
474492
///

0 commit comments

Comments
 (0)