3 % (c) The GRASP/AQUA Project, Glasgow University, 1998
5 \subsection[recvFrom.lc]{recvFrom run-time support}
10 #define NON_POSIX_SOURCE
12 #include "ghcSockets.h"
15 recvFrom__(fd, buf, nbytes, from)
25 sz = sizeof(struct sockaddr_in);
27 while ( (count = recvfrom((int)fd, (void*)buf, (int)nbytes, flags, (struct sockaddr*)from, &sz)) < 0) {
32 ghc_errtype = ERR_INVALIDARGUMENT;
33 ghc_errstr = "Not a valid read descriptor";
36 ghc_errtype = ERR_SYSTEMERROR;
37 ghc_errstr = "Message waiting to be read is not a data message";
40 ghc_errtype = ERR_INVALIDARGUMENT;
41 ghc_errstr = "Data buffer not in readable part of user address space";
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 reading";
52 ghc_errtype = ERR_INAPPROPRIATETYPE;
53 ghc_errstr = "Descriptor refers to a directory";
57 ghc_errtype = ERR_OTHERERROR;
58 ghc_errstr = "No data could be read immediately";