#include <unistd.h> #include <sys/types.h> #include <sys/uio.h> #include <sys/sendv.h>off_t sendv(int fd, struct sendv_iovec *iov, int iovcnt);
off64_t sendv64(int fd, struct sendv_iovec64 *iov, int iovcnt);
The iov argument points to an array of structures; each structure describes one write operation. For sendv, the iov argument points to a sendv_iovec structure that contains the following members:
off_t sendv_off; /* starting offset */ off_t sendv_len; /* length to send */ void *sendv_base; /* default source */ uint_t sendv_flags; /* SENDV_* flag bits */ int sendv_fd; /* source (not sendv_base) when SENDV_FD */
For sendv64, the iov argument points to a sendv_iovec64 structure that contains the following members:
off64_t sendv_off; /* starting offset */ off64_t sendv_len; /* length to send */ void *sendv_base; /* default source */ uint_t sendv_flags; /* SENDV_* flag bits */ int sendv_fd; /* source (not sendv_base) when SENDV_FD */
The size of the regular file specified by the sendv_fd
structure
element can be up to 2 gigabytes in size for sendv, and up to
1 terabyte for sendv64.
Otherwise, the two calls are identical.
The value of sendv_flags
specifies whether the source
is an open file descriptor or a buffer in user memory.
sendv_flags
can be set to:
SENDV_FD
SENDV_FD
is set in sendv_flags
, sendv
and sendv64 attempt to write sendv_len
bytes
starting at offset sendv_off
in the file specified by
sendv_fd
to the stream associated with fd.
If SENDV_FD
is not set, sendv and sendv64
attempt to write sendv_len
bytes from the buffer pointed to
by sendv_base
to the stream associated with fd.
Both calls process sendv_iovec entries sequentially.
errno
is not set.
If an error occurs and no data has been written,
``-1'' is returned and errno
is set as shown below.
sendv_fd
is not a valid file descriptor or is not open for reading.
sendv_fd
and cause a deadlock to occur.
sendv_base
points outside the
process's allocated address space.
sendv_len
is less than 0.
sendv_len
values in the iov array
was greater than the largest valid integer value (overflow).
sendv_flags
was set to an invalid value.
sendv_fd
is not a regular file.
sendv_off
is greater than the current size of the file
referenced by sendv_fd
.
sendv_fd
, so the call
could not go to sleep until the blocking record lock was removed.
sendv_fd
is on a remote machine and the link to that machine
is no longer active.
sendv_fd
is a regular file, sendv_len
is greater than 0,
the starting position is before the end-of-file and the starting position is
greater than or equal to the offset maximum established in
the open file descriptor associated with sendv_fd
.
There is no data transfer.
sendv_len
outside the specified minimum and
maximum write range, and the minimum value is non-zero.
A write to a STREAMS file can fail if an error message has been received at the stream head. In this case, errno is set to the value included in the error message.
sendv_fd
must be a regular file, and fd
must be a stream.
While one thread is blocked, siblings might still be executing.