3 % (c) The GRASP/AQUA Project, Glasgow University, 1996
5 \subsection[writeDescriptor.lc]{Stuff bytes down a descriptor}
10 #define NON_POSIX_SOURCE
12 #include "ghcSockets.h"
16 writeDescriptor(I_ fd, A_ buf, I_ nbytes)
20 while ((dumped = write((int) fd, (char *) buf, (int) nbytes)) < 0) {
28 ghc_errtype = ERR_INVALIDARGUMENT;
29 ghc_errstr = "Not a valid write descriptor";
32 ghc_errtype = ERR_RESOURCEEXHAUSTED;
33 ghc_errstr = "Disk quota exhausted";
36 ghc_errtype = ERR_INVALIDARGUMENT;
37 ghc_errstr = "Data not in writeable part of user address space";
40 ghc_errtype = ERR_RESOURCEEXHAUSTED;
41 ghc_errstr = "Maximum process or system file size exceeded";
44 ghc_errtype = ERR_INVALIDARGUMENT;
45 ghc_errstr = "Seek pointer associated with descriptor negative";
48 ghc_errtype = ERR_SYSTEMERROR;
49 ghc_errstr = "I/O error occurred while writing to file system";
52 ghc_errtype = ERR_RESOURCEEXHAUSTED;
53 ghc_errstr = "No space left on device";
56 ghc_errtype = ERR_SYSTEMERROR;
57 ghc_errstr = "Hangup occurred";
60 ghc_errtype = ERR_SYSTEMERROR;
61 ghc_errstr = "Write to not read pipe/unconnected socket caught";
64 ghc_errtype = ERR_INVALIDARGUMENT;
65 ghc_errstr = "Too much or too little written to descriptor";
69 ghc_errtype = ERR_OTHERERROR;
70 ghc_errstr = "No data could be written immediately";