2 % (c) The GRASP/AQUA Project, Glasgow University, 1996
4 \subsection[readDescriptor.lc]{Suck some bytes from a descriptor}
12 readDescriptor(int fd, char *buf, int nbytes)
16 while ((sucked = read(fd, buf, nbytes)) < 0) {
24 ghc_errtype = ERR_INVALIDARGUMENT;
25 ghc_errstr = "Not a valid write descriptor";
28 ghc_errtype = ERR_SYSTEMERROR;
29 ghc_errstr = "Message waiting to be read is not a data message";
32 ghc_errtype = ERR_INVALIDARGUMENT;
33 ghc_errstr = "Data buffer not in writeable part of user address space";
36 ghc_errtype = ERR_INVALIDARGUMENT;
37 ghc_errstr = "Seek pointer associated with descriptor negative";
40 ghc_errtype = ERR_SYSTEMERROR;
41 ghc_errstr = "I/O error occurred while writing to file system";
44 ghc_errtype = ERR_INAPPROPRIATETYPE;
45 ghc_errstr = "Descriptor refers to a directory";
49 ghc_errtype = ERR_OTHERERROR;
50 ghc_errstr = "No data could be written immediately";