[DragonFlyBSD - Bug #3283] (Resolved) mknodat() cannot create FIFOs

liweitianux bugtracker-admin at leaf.dragonflybsd.org
Thu Oct 1 06:04:24 PDT 2026


Issue #3283 has been updated by liweitianux.

Status changed from New to Resolved
Assignee set to swildner
% Done changed from 0 to 100

This has been fixed in commit fe44073222e684e0eb185a0745e826d67e50e275: mknod(2): Allow for the creation of fifos with mknod() to satisfy POSIX

Thank you.

----------------------------------------
Bug #3283: mknodat() cannot create FIFOs
http://bugs.dragonflybsd.org/issues/3283#change-14720

* Author: bhaible
* Status: Resolved
* Priority: Normal
* Assignee: swildner
* Category: Userland
* Target version: 6.4
* Start date: 2021-06-14
----------------------------------------
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:
<pre>
mknodat: Invalid argument
</pre>

<pre>

#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");
}

</pre>



-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account


More information about the Bugs mailing list