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"
15 writeDescriptor(I_ fd, A_ buf, I_ nbytes)
19 while ((dumped = write((int) fd, (char *) buf, (int) nbytes)) < 0) {
27 ghc_errtype = ERR_INVALIDARGUMENT;
28 ghc_errstr = "Not a valid write descriptor";
31 ghc_errtype = ERR_RESOURCEEXHAUSTED;
32 ghc_errstr = "Disk quota exhausted";
35 ghc_errtype = ERR_INVALIDARGUMENT;
36 ghc_errstr = "Data not in writeable part of user address space";
39 ghc_errtype = ERR_RESOURCEEXHAUSTED;
40 ghc_errstr = "Maximum process or system file size exceeded";
43 ghc_errtype = ERR_INVALIDARGUMENT;
44 ghc_errstr = "Seek pointer associated with descriptor negative";
47 ghc_errtype = ERR_SYSTEMERROR;
48 ghc_errstr = "I/O error occurred while writing to file system";
51 ghc_errtype = ERR_RESOURCEEXHAUSTED;
52 ghc_errstr = "No space left on device";
55 ghc_errtype = ERR_SYSTEMERROR;
56 ghc_errstr = "Hangup occurred";
59 ghc_errtype = ERR_SYSTEMERROR;
60 ghc_errstr = "Write to not read pipe/unconnected socket caught";
63 ghc_errtype = ERR_INVALIDARGUMENT;
64 ghc_errstr = "Too much or too little written to descriptor";
68 ghc_errtype = ERR_OTHERERROR;
69 ghc_errstr = "No data could be written immediately";