From c44a8fa57c772369a44fb1c093feabe37f4410cf Mon Sep 17 00:00:00 2001 From: implicitfield <114500360+implicitfield@users.noreply.github.com> Date: Mon, 29 Apr 2024 21:05:27 +0400 Subject: [PATCH] LibC: Implement `mkfifoat(2)` --- Userland/Libraries/LibC/stat.cpp | 6 ++++++ Userland/Libraries/LibC/sys/stat.h | 1 + 2 files changed, 7 insertions(+) diff --git a/Userland/Libraries/LibC/stat.cpp b/Userland/Libraries/LibC/stat.cpp index c6139a602a6..769634b971a 100644 --- a/Userland/Libraries/LibC/stat.cpp +++ b/Userland/Libraries/LibC/stat.cpp @@ -81,6 +81,12 @@ int mkfifo(char const* pathname, mode_t mode) return mknod(pathname, mode | S_IFIFO, 0); } +// https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkfifoat.html +int mkfifoat(int dirfd, char const* pathname, mode_t mode) +{ + return mknodat(dirfd, pathname, mode | S_IFIFO, 0); +} + static int do_stat(int dirfd, char const* path, struct stat* statbuf, bool follow_symlinks) { if (!path) { diff --git a/Userland/Libraries/LibC/sys/stat.h b/Userland/Libraries/LibC/sys/stat.h index e9a4e9b0300..67417a11ef9 100644 --- a/Userland/Libraries/LibC/sys/stat.h +++ b/Userland/Libraries/LibC/sys/stat.h @@ -20,6 +20,7 @@ int fchmod(int fd, mode_t); int mkdir(char const* pathname, mode_t); int mkdirat(int dirfd, char const* pathname, mode_t); int mkfifo(char const* pathname, mode_t); +int mkfifoat(int dirfd, char const* pathname, mode_t); int fstat(int fd, struct stat* statbuf); int lstat(char const* path, struct stat* statbuf); int stat(char const* path, struct stat* statbuf);