Add basic SO_ERROR support (XCC)
[akaros.git] / tools / compilers / gcc-glibc / glibc-2.19-akaros / sysdeps / akaros / getsockopt.c
index 139829d..536e1bd 100644 (file)
@@ -5,7 +5,7 @@
 #include <errno.h>
 #include <sys/socket.h>
 
-#include "plan9_sockets.h"
+#include <sys/plan9_helpers.h>
 
 static int sol_socket_gso(Rock *r, int optname, void *optval, socklen_t *optlen)
 {
@@ -18,6 +18,10 @@ static int sol_socket_gso(Rock *r, int optname, void *optval, socklen_t *optlen)
                        *(int*)optval = r->stype;
                        *optlen = 4;
                        break;
+               case (SO_ERROR):
+                       *(int*)optval = 0;
+                       *optlen = 4;
+                       break;
                default:
                        __set_errno(ENOPROTOOPT);
                        return -1;