I've got a program that I want to produce output for a file every
time the file is opened, so I decided that named pipes (FIFOs) were
the ideal method. Anyway, I mknod'd the file, and it fork's every
time the file is accessed. After the fork, it puts something out
on the file, and then the child quits. The parent does a waitpid
waiting for the child to exit, and then goes back and does it all
The only problem is that about 3/4 of the time, the program spews
about a random number of outputs in a row... As in, if it's supposed
to dump the number of times it's been accessed, and sometimes it
instead of just "Access 10...".
Previously, I was just trying to close the fifo, not using the fork,
but that never closed the fifo... it read forever. The fork works
most of the time, but I DON'T GET WHY IT DOESN'T ALL THE TIME!
What's the heck is up! The program is running under Linux 1.2.13
(slackware distribution originally).