Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (w) writev(2)
NAME
writev - Writes to a file from scattered buffers
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossesrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zossedll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yossedll
32-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/zputdll
64-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/yputdll
SYNOPSIS
#include <sys/types.h>
#include <sys/uio.h>
int writev(
int filedes,
struct iovec *iov,
int iov_count);
PARAMETERS
filedes Specifies an open file descriptor obtained from a successful call to the accept(),
creat(), creat64(), dup(), dup2( ), fcntl(), open(), open64(), pipe(), socket(),
or socketpair() function.
When the function is thread-aware, specifies an open file descriptor obtained
from a successful call to the creat(), creat64(), dup(), open(), open64(),
pipe( ), socket(),orsocketpair() function, or the thread-aware accept(),
dup2( ),orfcntl( ) function.
iov Points to a iovec structure that identifies the buffers containing the data to be
written.
iov_count Specifies the number of iovec structure entries (buffers) pointed to by the iov
parameter.
DESCRIPTION
The writev( ) function attempts to write data to the file associated with the filedes parameter from
the set of buffers pointed to by the iov parameter.
The writev( ) function performs the same action as the write( ) function, but gathers the output
data from the iov_count buffers specified by the iovec structure buffers pointed to by the iov
parameter.
The iovec structure is defined in the sys/uoi.h header file and contains entries with these
members:
caddr_t iov_base;
int iov_len;
The iov_base and iov_len members of each iovec structure entry specify the base address and
length of an area in memory from which data should be written. The writev( ) function always
writes a complete buffer before proceeding to the next.
With regular files and devices capable of seeking, the actual writing of data proceeds from the
position in the file indicated by the file pointer. If this incremented file pointer is greater than the
length of the file, the length of the file is set to this file offset. Upon return from the writev( )
function, the file pointer is incremented by the number of bytes actually written.
527186-023 Hewlett-Packard Company 10−25