libc: add SO_LINGER and TCP_NODELY to socket fs plugin

issue #3060
This commit is contained in:
Sebastian Sumpf 2018-10-09 13:58:48 +02:00 committed by Christian Helmuth
parent 48e07d7dff
commit d3dbdae395
1 changed files with 13 additions and 0 deletions

View File

@ -29,6 +29,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <ctype.h>
#include <netinet/tcp.h>
#include <stdio.h>
#include <sys/ioctl.h>
@ -765,8 +766,20 @@ extern "C" int socket_fs_setsockopt(int libc_fd, int level, int optname,
case SO_REUSEADDR:
/* not yet implemented - always return true */
return 0;
case SO_LINGER:
{
linger *l = (linger *)optval;
if (l->l_onoff == 0)
return 0;
}
default: return Errno(ENOPROTOOPT);
}
case IPPROTO_TCP:
switch (optname) {
case TCP_NODELAY:
return 0;
default: return Errno(ENOPROTOOPT);
}
default: return Errno(EINVAL);
}