WYRDTEK Home Features Reference Downloads About


Reference/es_rb_read

Syntax

int es_rb_read( struct es_rb *rbuf, void *buf, unsigned size );

Arguments

struct es_rb *rbuf Read-buffer.
void *buf User supplied buffer to read into.
unsigned size Number of bytes to read.

Description

Read size bytes into the user-supplied buffer buf from the file descriptor associated with the read-buffer rbuf.

Returns zero on success and returns errno (from the standard library errno.h) on error. Returns -1 on end-of-file (EOF for files or connection reset for sockets).

es_rb_read() differs from the read() system call in that in normal operation it will always read exactly size bytes (blocking on underlying file descriptor if necessary) rather than reading any number of bytes up to and including size.

[Back To Reference] [Back To Reference/es_rb]