diff options
author | simonmar <unknown> | 1999-11-26 16:29:44 +0000 |
---|---|---|
committer | simonmar <unknown> | 1999-11-26 16:29:44 +0000 |
commit | 7700dda03d273676b274bc148491a4e02a7c5ae0 (patch) | |
tree | 09de9743e3b9f9c7a4108660230969ce893947df /ghc/lib/misc/cbits/socketOpt.c | |
parent | ef33ed94129ee17b577add392e04619ec1f53800 (diff) | |
download | haskell-7700dda03d273676b274bc148491a4e02a7c5ae0.tar.gz |
[project @ 1999-11-26 16:29:09 by simonmar]
GHC bits for new library organisation.
Diffstat (limited to 'ghc/lib/misc/cbits/socketOpt.c')
-rw-r--r-- | ghc/lib/misc/cbits/socketOpt.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/ghc/lib/misc/cbits/socketOpt.c b/ghc/lib/misc/cbits/socketOpt.c deleted file mode 100644 index 21ce7a2d23..0000000000 --- a/ghc/lib/misc/cbits/socketOpt.c +++ /dev/null @@ -1,47 +0,0 @@ -#if 0 -% -% (c) The GRASP/AQUA Project, Glasgow University, 1998 -% -\subsection[socketOpt.lc]{Setting/Getting socket opts} - -\begin{code} -#endif - -#define NON_POSIX_SOURCE -#include "Rts.h" -#include "ghcSockets.h" -#include "stgio.h" - -StgInt -getSocketOption__ (StgInt fd, StgInt opt, StgInt level) -{ - int optval, sz_optval, rc; - - sz_optval = sizeof(int); - - while ( (rc = getsockopt((int)fd, level, opt, &optval, &sz_optval)) < 0 ) { - if (errno != EINTR) { - cvtErrno(); - stdErrno(); - return -1; - } - } - return optval; -} - -StgInt -setSocketOption__ (StgInt fd, StgInt opt, StgInt level, StgInt val) -{ - int optval, rc; - - optval = val; - - while ( (rc = setsockopt((int)fd, level, opt, &optval, sizeof(optval))) < 0 ) { - if (errno != EINTR) { - cvtErrno(); - stdErrno(); - return -1; - } - } - return 0; -} |