libc: pretend to support SO_ERROR

There are programs, e.g. curl, that check if a connection was
established successfully by looking at SO_ERROR. Pretend that
the getsockopt() call was executed to keep them happy. If they
try to use a broken connection, the other socket functions will
bail.
This commit is contained in:
Josef Söntgen 2017-05-18 16:33:33 +02:00 committed by Christian Helmuth
parent 5b6735e1c9
commit dbec8d7710
1 changed files with 4 additions and 0 deletions

View File

@ -673,6 +673,10 @@ extern "C" int socket_fs_getsockopt(int libc_fd, int level, int optname,
Genode::log("getsockopt: SO_REUSEADDR not yet implemented - return true");
*(int *)optval = 1;
return 0;
case SO_ERROR:
Genode::log("getsockopt: SO_ERROR not yet implemented - return true");
*(int *)optval = 0;
return 0;
default: return Errno(ENOPROTOOPT);
}