Documentation  |   Table of Contents   |  < Previous   |  Next >   |  Index

22    uio.h

Palm OS® Protein C/C++ Compiler Language & Library Reference

Palm OS® Developer Suite

The <uio.h> header defines two functions useful for vector I/O operations, as well as the iovec structure they require.

Structures and Types ^TOP^

iovec Struct ^TOP^

Purpose

Defines an I/O vector; that is, a buffer address and size.

Declared In

posix/sys/uio.h

Prototype

struct iovec {
   void *iov_base;
   size_t iov_len;
}

Fields

iov_base
The base address of a memory region for input or output.
iov_len
The size of the memory pointed to by iov_base.

Functions and Macros ^TOP^

readv Function ^TOP^

Purpose

Performs the same action as read(), but scatters the input data into the iovcnt buffers specified by the members of the iov array: iov[0], iov[1], ..., iov[iovcnt-1].

Declared In

posix/sys/uio.h

Prototype

ssize_t readv (
   int d,
   const struct iovec *iov,
   size_t iovcnt
)

Parameters

d
The position to start reading from.
iov
The array.
iovcnt
The buffer.

Returns

Returns the number of bytes actually read and placed in the buffer. Zero (0) is returned if end-of-file is read. Otherwise, -1 is returned and the global variable errno is set to indicate the error.

See Also

read()

writev Function ^TOP^

Purpose

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].

Declared In

posix/sys/uio.h

Prototype

ssize_t writev (
   int d,
   const struct iovec *iov,
   size_t iovcnt
)

Parameters

d
The position to start gathering from.
iov
The array.
iovcnt
The buffer.

Returns

Returns the number of bytes actually written. Otherwise, -1 is returned and the global variable errno is set to indicate the error.

See Also

write()