coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: differece between mkfifo and mknod ... p


From: Bob Proulx
Subject: Re: differece between mkfifo and mknod ... p
Date: Wed, 24 Mar 2021 15:52:28 -0600

Peng Yu wrote:
> It seems that both `mkfifo` and `mknod ... p` can create a fifo. What
> is the difference between them? Thanks.

The mknod utility existed "for a decade" in Unix (don't quote me on
that vague time statement) before mkfifo existed.  The mknod utility
existed in Unix v7 as a thin wrapper around the mknod(2) system call.

    man 2 mknod

    https://pubs.opengroup.org/onlinepubs/9699919799/functions/mknod.html

Named pipes are special files and special files are created with
mknod.  At least that was true until mkfifo came along.  mkfifo was
standardized by POSIX while the mknod utility seems too OS specific
and never made it into the standards as far as I know.

Therefore "mkfifo" should be used for standards compliance and "mknod"
should continue to exist for backwards compatibility.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]