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