(scm_init_socket): Add IPPROTO_IP, IPPROTO_TCP,
authorKevin Ryde <user42@zip.com.au>
Sun, 23 Oct 2005 21:35:01 +0000 (21:35 +0000)
committerKevin Ryde <user42@zip.com.au>
Sun, 23 Oct 2005 21:35:01 +0000 (21:35 +0000)
IPPROTO_UDP.  Remove SOL_IP, SOL_TCP, SOL_UDP.  The former are in
POSIX spec examples, the latter are not available on for instance
NetBSD.

libguile/socket.c

index 28833df..6dfc800 100644 (file)
@@ -1341,18 +1341,25 @@ scm_init_socket ()
   scm_c_define ("SOCK_RDM", scm_from_int (SOCK_RDM));
 #endif
 
-  /* setsockopt level.  */
+  /* setsockopt level.
+
+     SOL_IP, SOL_TCP and SOL_UDP are defined on gnu/linux, but not on for
+     instance NetBSD.  We define IPPROTOs because that's what the posix spec
+     shows in its example at
+
+     http://www.opengroup.org/onlinepubs/007904975/functions/getsockopt.html
+  */
 #ifdef SOL_SOCKET
   scm_c_define ("SOL_SOCKET", scm_from_int (SOL_SOCKET));
 #endif
-#ifdef SOL_IP
-  scm_c_define ("SOL_IP", scm_from_int (SOL_IP));
+#ifdef IPPROTO_IP
+  scm_c_define ("IPPROTO_IP", scm_from_int (IPPROTO_IP));
 #endif
-#ifdef SOL_TCP
-  scm_c_define ("SOL_TCP", scm_from_int (SOL_TCP));
+#ifdef IPPROTO_TCP
+  scm_c_define ("IPPROTO_TCP", scm_from_int (IPPROTO_TCP));
 #endif
-#ifdef SOL_UDP
-  scm_c_define ("SOL_UDP", scm_from_int (SOL_UDP));
+#ifdef IPPROTO_UDP
+  scm_c_define ("IPPROTO_UDP", scm_from_int (IPPROTO_UDP));
 #endif
 
   /* setsockopt names.  */