This is a can of worms, what's the size of PIPE_BUF? Surely that's the output of 'getconf PIPE_BUF /tmp' Whoa, why's that so small, that can't be right. I'll run this test with dd on my FreeBSD box and see what it really is. What in... it CHANGES!? Okay I'll just use 512.
So writes are atomic but what about reads? Oh that's why pathconf(9) returned that small number! You sure? What if a signal sneaks in while reading?
So writes are atomic but what about reads? Oh that's why pathconf(9) returned that small number! You sure? What if a signal sneaks in while reading?