4 Reads bytes from a file or socket.
14 PRInt32 PR_Read(PRFileDesc *fd,
22 The function has the following parameters:
25 A pointer to a :ref:`PRFileDesc` object for the file or socket.
27 A pointer to a buffer to hold the data read in. On output, the buffer
30 The size of ``buf`` (in bytes).
36 One of the following values:
38 - A positive number indicates the number of bytes actually read in.
39 - The value 0 means end of file is reached or the network connection is
41 - The value -1 indicates a failure. To get the reason for the failure,
42 call :ref:`PR_GetError`.
48 The thread invoking :ref:`PR_Read` blocks until it encounters an
49 end-of-stream indication, some positive number of bytes (but no more
50 than ``amount`` bytes) are read in, or an error occurs.