123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- /*++
- Copyright (c) 2015 Minoca Corp.
- This file is licensed under the terms of the GNU General Public License
- version 3. Alternative licensing terms are available. Contact
- info@minocacorp.com for details. See the LICENSE file at the root of this
- project for complete licensing information.
- Module Name:
- uio.h
- Abstract:
- This header contains definitions for scatter/gather I/O operations.
- Author:
- Evan Green 15-Jan-2015
- --*/
- #ifndef _SYS_UIO_H
- #define _SYS_UIO_H
- //
- // ------------------------------------------------------------------- Includes
- //
- #include <sys/types.h>
- //
- // ---------------------------------------------------------------- Definitions
- //
- #ifdef __cplusplus
- extern "C" {
- #endif
- //
- // ------------------------------------------------------ Data Type Definitions
- //
- /*++
- Structure Description:
- This structure defines the type for a portion of an I/O buffer.
- Members:
- iov_base - Stores a pointer to the base of the data.
- iov_len - Stores the length of the data.
- --*/
- struct iovec {
- void *iov_base;
- size_t iov_len;
- };
- //
- // -------------------------------------------------------------------- Globals
- //
- //
- // -------------------------------------------------------- Function Prototypes
- //
- LIBC_API
- ssize_t
- readv (
- int FileDescriptor,
- const struct iovec *IoVector,
- int IoVectorCount
- );
- /*++
- Routine Description:
- This routine is equivalent to the read function, except that it places data
- into the buffers specified by the given I/O vector array.
- Arguments:
- FileDescriptor - Supplies the file descriptor to read from.
- IoVector - Supplies a pointer to an array of I/O vectors.
- IoVectorCount - Supplies the number of elements in the I/O vector array.
- That is, IoVector[IoVectorCount - 1] will be the last array element
- accessed.
- Return Value:
- Returns the same values a read would (the number of bytes read on success,
- or -1 on error with errno set to contain more information).
- --*/
- LIBC_API
- ssize_t
- writev (
- int FileDescriptor,
- const struct iovec *IoVector,
- int IoVectorCount
- );
- /*++
- Routine Description:
- This routine is equivalent to the write function, except that it reads data
- from the buffers specified by the given I/O vector array.
- Arguments:
- FileDescriptor - Supplies the file descriptor to write to.
- IoVector - Supplies a pointer to an array of I/O vectors.
- IoVectorCount - Supplies the number of elements in the I/O vector array.
- That is, IoVector[IoVectorCount - 1] will be the last array element
- accessed.
- Return Value:
- Returns the same values a write would (the number of bytes written on
- success, or -1 on error with errno set to contain more information).
- --*/
- #ifdef __cplusplus
- }
- #endif
- #endif
|