Write

The structure of the write system call is just as simple as that of the read routine. Both code flow diagrams are identical except that the f_op->write and do_sync_write functions are used instead of their read equivalents.

From a formal point of view, sys_write requires the same parameters as sys_read — a file descriptor, a pointer variable, and a length specification (expressed as an integer number). Obviously, their meanings are slightly different. The pointer does not point to a buffer area in which the data to be read are stored but to the data to be written to the file. The length argument specifies the length of these data in bytes.

Write operations are likewise directed through the cache system of the kernel (we discuss this topic extensively in Chapter 16).

Continue reading here: Standard Functions

Was this article helpful?

0 0