This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How write() works


Hi,

I'm trying to find out how write() works, specifically what has happened before it returns successfully - in relation to regular files. What I want to know is has that data been written to its final storage medium, or has it just been transferred to kernel space?

Assuming that the length returned is the same length requested, I assume that one of the two scenarios are true :

1) The data has been written to kernel memory, and may or may not have yet been written to the final storage location. The data will be flushed to the final storage medium asynchronously by the kernel, but all reads will return the updated data.

2) The data has been written to the final storage medium (and hence the write() function blocked until the writing finished).

I'm assuming that it is situation 1, but I'd like to be certain. Any clarification on this would be much appreciated.

Thanks,

Marcus.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]