Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>read</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
read
====

Syntax
------

     #include <unistd.h>
     
     ssize_t read(int fd, void *buffer, size_t length);

Description
-----------

This function reads at most LENGTH bytes from file FD into BUFFER.
Note that in some cases, such as end-of-file conditions and text files,
it may read less than the requested number of bytes.  At end-of-file,
`read' will read exactly zero bytes.

Return Value
------------

The number of bytes read, zero meaning end-of-file, or -1 for an error.

Example
-------

     char buf[10];
     int r = read(0, buf, 10);


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson