Skip to main content

Name

io_wrapper_read — Read the specified number of bytes

Synopsis

#include "io_wrapper.h"

| int **io_wrapper_read** ( | io, |   | |   | buf, |   | |   | nbytes); |   |

io_object * <var class="pdparam">io</var>; void * <var class="pdparam">buf</var>; int <var class="pdparam">nbytes</var>;

Description

Read the specified number of bytes into the buffer. This function behaves like the system function read(2).

Parameters

io

The resource.

buf

The buffer to read into.

nbytes

The number of bytes to read.

Return Values

On success, this function returns the number of bytes read and the file position is advanced by this number. On failure, it returns -1 and sets errno appropriately to a system error defined by read(2).

Threading

It is legal to call this function in any thread.

See Also

Was this page helpful?