Opened 3 months ago
Closed 3 months ago
#19032 closed bug (fixed)
mknod and mknodat don't support the S_IFIFO flag
Reported by: | bhaible | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta5 |
Component: | System/POSIX | Version: | R1/beta5 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
According to POSIX https://pubs.opengroup.org/onlinepubs/9799919799/functions/mknod.html, mknod() and mknodat() with an argument flag of S_IFIFO and a zero device argument should act like mkfifo() and mkfifoat(), respectively.
This does not work in Haiku hrev57823 (from 2024-07-15).
How to reproduce: Store this as foo.c.
#include <stdio.h> #include <unistd.h> #include <sys/stat.h> #include <fcntl.h> int main () { int ret; ret = mkfifo ("test1", 0600); printf ("ret = %d\n", ret); ret = mkfifoat (AT_FDCWD, "test2", 0600); printf ("ret = %d\n", ret); ret = mknod ("test3", 0600 | S_IFIFO, 0); if (ret < 0) perror ("mknod"); printf ("ret = %d\n", ret); ret = mknodat (AT_FDCWD, "test4", 0600 | S_IFIFO, 0); if (ret < 0) perror ("mknodat"); printf ("ret = %d\n", ret); }
Compile and run this program:
gcc -Wall foo.c rm -f test1 test2 test3 test4 ./a.out
Expected output:
ret = 0 ret = 0 ret = 0 ret = 0
Actual output:
ret = 0 ret = 0 mknod: Not supported ret = -1 mknodat: Not supported ret = -1
Attachments (1)
Change History (3)
by , 3 months ago
comment:1 by , 3 months ago
Component: | - General → System/POSIX |
---|
comment:2 by , 3 months ago
Milestone: | Unscheduled → R1/beta5 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in hrev58037 +beta5.
Note:
See TracTickets
for help on using tickets.
test case foo.c