summaryrefslogtreecommitdiff
path: root/ghc/lib/misc/cbits/socketOpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/lib/misc/cbits/socketOpt.c')
-rw-r--r--ghc/lib/misc/cbits/socketOpt.c47
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;
-}