Reads bytes from a file or socket.

Syntax

#include <prio.h>

PRInt32 PR_Read(PRFileDesc *fd,
               void *buf,
               PRInt32 amount);

Parameters

The function has the following parameters:

fd
A pointer to a PRFileDesc object for the file or socket.
buf
A pointer to a buffer to hold the data read in. On output, the buffer contains the data.
amount
The size of buf (in bytes).

Returns

One of the following values:

Description

The thread invoking PR_Read blocks until it encounters an end-of-stream indication, some positive number of bytes (but no more than amount bytes) are read in, or an error occurs.