receive - receive bytes from a file descriptor
#include <libcgc.h> int receive(int fd, void *buf, size_t count, size_t *rx_bytes)
receive system call reads up to
count bytes from file descriptor
fd to the buffer pointed to by
count is zero,
returns 0 and optionally sets
*rx_bytes to zero.
receive function is invoked through system call number 3.
On success, zero is returned and, if
rx_bytes is not
NULL, the number
of bytes received is returned in
*rx_bytes (zero indicates nothing
was received or end-of-file). On error, an error code is returned and
*rx_bytes is left unmodified.
fdis not a valid file descriptor or is not open.
bufor rx_bytes points to an invalid address.