HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
w
write(2) write(2)
[EDEADLK] A resource deadlock would occur as a result of this operation (see lockf(2) and
fcntl(2)).
[EDQUOT] User’s disk quota block limit has been reached for this file system.
[EFBIG] The file is a regular file and nbyte is greater than zero and the starting position is
greater than or equal to the offset maximum established in the open file description
associated with ldes.
[ENOLCK] The system record lock table is full, preventing the write from sleeping until the
blocking record lock is removed.
[ENOSPC] Not enough space on the file system. The process does not possess the limit
effective privilege to override this restriction.
If writev() fails, the file offset remains unchanged and errno is set to one of the following values:
[EFAULT] iov_base or iov points outside of the allocated address space. The reliable detection of
this error is implementation dependent.
[EINVAL] One of the iov_len values in the iov array is negative.
If write() or writev() fails, the file offset is updated to reflect the amount of data transferred and
errno is set to one of the following values.
[EFAULT] buf points outside the process’s allocated address space. The reliable detection of this
error is implementation dependent.
EXAMPLES
Assuming a process opened a file for writing, the following call to write() attempts to write mybufsize
bytes to the file from the buffer to which mybuf points.
#include <string.h>
int fildes;
size_t mybufsize;
ssize_t nbytes;
char *mybuf = "aeiou and sometimes y";
mybufsize = (size_t)strlen (mybuf);
nbytes = write (fildes, (void *)mybuf, mybufsize);
WARNINGS
Check signal(5) for the appropriateness of signal references on systems that support
sigvector() (see
sigvector(2)).
sigvector() can affect the behavior described on this page.
Character special devices, and raw disks in particular, apply constraints on how write() can be used.
See specific Section 7 manual entries for details on particular devices.
AUTHOR
write() was developed by HP, AT&T, and the University of California, Berkeley.
SEE ALSO
mkfs(1M) creat(2), dup(2), fcntl(2), lockf(2), lseek(2), open(2), pipe(2), sigvector(2), ulimit(2), ustat(2), sig-
nal(5).
STANDARDS CONFORMANCE
write(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, POSIX.4
HP-UX Release 11i: December 2000 2 Section 2463
___
___