write (system call)
System call in a Unix-like operating system kernel / From Wikipedia, the free encyclopedia
Dear Wikiwand AI, let's keep it short by simply answering these key questions:
Can you list the top facts and stats about Write (system call)?
Summarize this article for a 10 year old
SHOW ALL QUESTIONS
The write is one of the most basic routines provided by a Unix-like operating system kernel. It writes data from a buffer declared by the user to a given device, such as a file. This is the primary way to output data from a program by directly using a system call. The destination is identified by a numeric code. The data to be written, for instance a piece of text, is defined by a pointer and a size, given in number of bytes.
write
thus takes three arguments:
- The file code (file descriptor or fd).
- The pointer to a buffer where the data is stored (buf).
- The number of bytes to write from the buffer (nbytes).