Atomic Read and Write with stdio

hi guys.

can we use fread and fwrite with pipes to write data more than PIPE_BUF atomically since they lock FILE object until I/O operation finish?

File I/O is not atomic.