3 ms·
I don't understand, are you proposing some new kernel modes for i/o? Because the log file thing probably doesn't work as I don't think O_APPEND prevents multipl
by peterwwillis 10y ago
I don't understand, are you proposing some new kernel modes for i/o? Because the log file thing probably doesn't work as I don't think O_APPEND prevents multiple processes from clobbering each other's writes. And O_SYNC seems to do what your api/callback thing would do. And this isn't enough locking methods to satisfy all applications.
- Animats 10y agoO_APPEND semantics are not consistent for all systems when multiple processes are writing. In early UNIX systems, there was one seek pointer for processes which shared an open file descriptor. This is why multiple commands launched by the shell can write to the same standard output file without overwriting. But if two processes open the same file for append, in some older versions of Unix they can interfere. POSIX does not guarantee atomicity here. Linux does, mostly, except on NFS. Previous discussion on HN.[1] This, too, should Just Work. [1] https://news.ycombinator.com/item?id=12220489 https://news.ycombinator.com/item?id=12220489