Add basic SO_ERROR support (XCC)
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 30 Aug 2016 18:20:30 +0000 (14:20 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 30 Aug 2016 18:20:30 +0000 (14:20 -0400)
Dropbear checks SO_ERROR to see if there was a problem.  We currently don't
track errors at the socket layer, but we can at least say there was no
issue.  In the future, we can extend the Rock/socket shims to track recent
errors if we want.

Rebuild glibc.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getsockopt.c

index 63a3169..536e1bd 100644 (file)
@@ -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;