R_WRITE(3)

FUNCTION
r_write - Write bytes to a file descriptor.

SYNOPSIS
#include <karma_r.h>

iaddr r_write

(int fd, CONST char *buf, uaddr nbytes)

DESCRIPTION
This routine is similar to the system <<write(2)>> call, except that the number of bytes requested is always returned (except on error). Hence, if the descriptor references a socket, the routine will write as much data as was requested, rather than a lesser amount due to packetisation or interrupted system calls.

fd  The file descriptor to write to. This descriptor must NOT be set to non-blocking IO.

buf The buffer in which to write the data.

nbytes
    The number of bytes to write.

RETURN VALUE
The number of bytes requested on success, else -1 indicating error.

Multi-threading Level
Unsafe.

NOTE
The routine will force SIGPIPE to be ignored.

AUTHOR
Richard Gooch (rgooch@atnf.csiro.au)

AVAILABLITY
The Karma Distribution is available for anonymous ftp from: ftp://ftp.atnf.csiro.au/pub/software/karma/ ftp://wuarchive.wustl.edu/graphics/graphics/packages/karma/ ftp://ftp.pwr.wroc.pl/pub/karma/ The Karma Home Page is: http://www.atnf.csiro.au/karma/