This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Write bytes to a file
#include <sys/uio.h> ssize_t writev( int fildes, const iov_t* iov, int iovcnt );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The writev() function performs the same action as write(), but gathers the output data from the iovcnt buffers specified by the members of the iov array: iov[0], iov[1], ..., iov[iovcnt-1].
For writev(), the iov_t structure contains the following members:
The writev() function always writes a complete area before proceeding to the next.
The maximum number of entries in the iov array is UIO_MAXIOV.
Note that writev() ignores advisory locks that may have been set by the fcntl() function. |
If writev() is interrupted by a signal before it has written any data, it returns a value of -1, and errno is set to EINTR. However, if writev() is interrupted by a signal after it has successfully written some data, it will return the number of bytes written.
For more details, see the write() function.
The number of bytes written, or -1 if an error occurs (errno is set).
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
close(), creat(), dup(), dup2(), errno, fcntl(), lseek(), open(), pipe(), read(), readv(), select(), write()