[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 17/23: getsockopt: allow raw file descriptors
From: |
Andy Wingo |
Subject: |
[Guile-commits] 17/23: getsockopt: allow raw file descriptors |
Date: |
Thu, 24 Mar 2016 14:26:04 +0000 |
wingo pushed a commit to branch wip-ethreads
in repository guile.
commit 377dc7d55c60e4820b8a77db886b0531bd5308e8
Author: Andy Wingo <address@hidden>
Date: Tue Mar 27 20:46:02 2012 +0200
getsockopt: allow raw file descriptors
* libguile/socket.c (scm_getsockopt): Allow raw file descriptors.
---
libguile/socket.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/libguile/socket.c b/libguile/socket.c
index 86c6191..69776d3 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -485,12 +485,17 @@ SCM_DEFINE (scm_getsockopt, "getsockopt", 3, 0, 0,
int ilevel;
int ioptname;
- sock = SCM_COERCE_OUTPORT (sock);
- SCM_VALIDATE_OPFPORT (1, sock);
+ if (scm_is_integer (sock))
+ fd = scm_to_int (sock);
+ else
+ {
+ sock = SCM_COERCE_OUTPORT (sock);
+ SCM_VALIDATE_OPFPORT (1, sock);
+ fd = SCM_FPORT_FDES (sock);
+ }
ilevel = scm_to_int (level);
ioptname = scm_to_int (optname);
- fd = SCM_FPORT_FDES (sock);
if (getsockopt (fd, ilevel, ioptname, (void *) &optval, &optlen) == -1)
SCM_SYSERROR;
- [Guile-commits] 10/23: EOF fix for continuation-line?, (continued)
- [Guile-commits] 10/23: EOF fix for continuation-line?, Andy Wingo, 2016/03/24
- [Guile-commits] 19/23: nio: add non-blocking connect, Andy Wingo, 2016/03/24
- [Guile-commits] 08/23: add #:limit to get-bytevector-delimited, Andy Wingo, 2016/03/24
- [Guile-commits] 11/23: socket: TCP_CORK, TCP_NODELAY, Andy Wingo, 2016/03/24
- [Guile-commits] 23/23: virtualize read/write/close operations in <eport>, Andy Wingo, 2016/03/24
- [Guile-commits] 15/23: (web server ethreads): more use of latin1 accessors, Andy Wingo, 2016/03/24
- [Guile-commits] 01/23: add (ice-9 nio), Andy Wingo, 2016/03/24
- [Guile-commits] 20/23: eports: nonblocking connect-eport, Andy Wingo, 2016/03/24
- [Guile-commits] 14/23: refactoring to (web server ethreads) read-http-line, Andy Wingo, 2016/03/24
- [Guile-commits] 02/23: add (ice-9 eports), Andy Wingo, 2016/03/24
- [Guile-commits] 17/23: getsockopt: allow raw file descriptors,
Andy Wingo <=
- [Guile-commits] 16/23: eports: add put-utf8-char, put-utf8-string, Andy Wingo, 2016/03/24
- [Guile-commits] 03/23: add (ice-9 epoll), Andy Wingo, 2016/03/24
- [Guile-commits] 21/23: eports tweak, Andy Wingo, 2016/03/24
- [Guile-commits] 07/23: add (web server ethreads), Andy Wingo, 2016/03/24
- [Guile-commits] 22/23: add examples/ethreads/memcached-{client, server}, Andy Wingo, 2016/03/24