Project

General

Profile

Bug #3283

mknodat() cannot create FIFOs

Added by bhaible about 2 months ago. Updated 20 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Userland
Target version:
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");
}

History

#1

Updated by tuxillo 20 days ago

  • Target version set to 6.2

Also available in: Atom PDF