RTEMS Logo

RTEMS 4.10.2 On-Line Library


Input and Output Primitives Manager writev - Vectored write to a file

PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

5.4.15: writev - Vectored write to a file

CALLING SEQUENCE:

#include <sys/uio.h>

ssize_t writev(
  int                 fd,
  const struct iovec *iov,
  int                 iovcnt
);

STATUS CODES:

In addition to the errors detected by Input and Output Primitives Manager write - Write to a file, write(), this routine may return -1 and sets errno based upon the following errors:

EINVAL
The sum of the iov_len values in the iov array overflowed an ssize_t.
EINVAL
The iovcnt argument was less than or equal to 0, or greater than IOV_MAX.

DESCRIPTION:

The writev() function is equivalent to write(), except as noted here. The writev() function gathers output data from the iovcnt buffers specified by the members of the iov array: iov[0], iov[1], ..., iov[iovcnt-1]. The iovcnt argument is valid if greater than 0 and less than or equal to IOV_MAX.

Each iovec entry specifies the base address and length of an area in memory from which data should be written. The writev() function always writes a complete area before proceeding to the next.

If fd refers to a regular file and all of the iov_len members in the array pointed to by iov are 0, writev() returns 0 and has no other effect. For other file types, the behavior is unspecified by POSIX.

NOTES:

NONE


PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

Copyright © 1988-2008 OAR Corporation