Monday, June 6, 2011

pipe correct it

-If we read from a pipe whose write end has been closed, read returns 0
-If we write to a pipe whose read end has been closed, the signal SIGPIPE is generated

FIFO

- “mknod” command is used to create the fifo, mkfifo command is not available for C program in many linux distributions

- Once created you can use same open, read as you do on normal files

- O_NONBLOCK will depict the blocking behavior of FIFO same as pipes

- Pipe buffer is defined by the constant PIPE_BUF in limits.h header. I checked for me its 4k

- As many process can write to the file some sort of atomicity is required for these operations.

No comments: