The write call interface123 is standardized by the POSIX specification. Data is written to a file by calling the write function. The function prototype is:
In above syntax, ssize_t is a typedef. It is a signed data type defined in stddef.h. Note that write() does not return an unsigned value; it returns -1 if an error occurs so it must return a signed value. The write function returns the number of bytes successfully written into the file, which may at times be less than the specified nbytes. It returns -1 if an exceptional condition is encountered, see section on errors below.
On Linux, write is system call number 1.4
http://www.unix.com/man-page/FreeBSD/2/write/ Manual page for Write http://www.unix.com/man-page/FreeBSD/2/write/ ↩
https://www.gnu.org/s/hello/manual/libc/I_002fO-Primitives.html#I_002fO-Primitives I/O Primitives https://www.gnu.org/s/hello/manual/libc/I_002fO-Primitives.html#I_002fO-Primitives ↩
"Write". http://pubs.opengroup.org/onlinepubs/007904875/functions/write.html ↩
"Linux/Arch/X86/Entry/Syscalls/Syscall_64.TBL at master · torvalds/Linux". GitHub. https://github.com/torvalds/linux/blob/master/arch/x86/entry/syscalls/syscall_64.tbl ↩