Actions
Bug #3283
openmknodat() cannot create FIFOs
Start date:
06/14/2021
Due date:
% Done:
0%
Estimated time:
Description
According to POSIX https://pubs.opengroup.org/onlinepubs/9699919799/functions/mknodat.html
mknodat(AT_FDCWD, filename, mode | S_IFIFO, 0)
should create a FIFO, just like
mkfifoat(AT_FDCWD, filename, mode)
But mknodat fails with EINVAL instead.
How to reproduce: Run this program.
It prints:
mknodat: Invalid argument
#include <errno.h> #include <fcntl.h> #include <stdio.h> #include <sys/stat.h> int main () { int ret = mkfifoat (AT_FDCWD, "fifo1", 0600); if (ret < 0) perror ("mkfifoat"); ret = mknodat (AT_FDCWD, "fifo2", 0600 | S_IFIFO, 0); if (ret < 0) perror ("mknodat"); }
Actions