] Compile the program below and run it. On FreeBSD it produces:
] mknod: Invalid argument
]
] Why ??
] I thought this should run on FreeBSD without using mkfifo.
] if ( (mknod("fifo", S_IFIFO|0666, 0))==-1 )
] perror("mknod");
Because mknod() can't make FIFO's.
For Linux and IBCS2 compatability, the system call, when called
from those binaries, *will* make a FIFO.
This is a generic BSD'ism, and has been around forever (since
back when FIFO's weren't unified with an FS switch). It should
probably be changed to conform with reality, and the mkfifo()
call should be legacied into libcompat as a call to mknod. This
is one of the *few* occasions where "BSD flavor" is sour.
Terry Lambert
---
Any opinions in this posting are my own and not those of my present
or previous employers.