All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.
@(#)write.2 4.1 (Berkeley) 05/09/85
write(fildes, buffer, nbytes) char *buffer;
Buffer is the address of nbytes contiguous bytes which are written on the output file. The number of characters actually written is returned. It should be regarded as an error if this is not the same as requested.
Writes which are multiples of 1024 characters long and begin on a 1024-byte boundary in the file are more efficient than any others.
Write s to the control terminal by a process which is not in the process group of the termainl and which is not ignoring or holding SIGTTOU signals cause the writer's process group to receive a SIGTTOU signal (See jobs (3) and the description of the LTOSTOP option in tty (4) for details).
On some systems write clears the set-user-id bit on a file. This prevents penetration of system security by a user who \*(lqcaptures\*(rq a writeable set-user-id file owned by the super-user.
(file descriptor in r0)
sys write; buffer; nbytes
(byte count in r0)
Processes which have been orphaned by their parents and have been inherited by init (8) never receive SIGTTOU signals. Output by such a process is permitted even when they are not in the process group of the control terminal.