Cygwin: AF_UNIX: implement getsockopt SO_RCVBUF/SO_SNDBUF

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2018-03-07 21:56:42 +01:00
parent 483cbf8954
commit 7d525c171f
1 changed files with 10 additions and 0 deletions

View File

@ -1780,6 +1780,16 @@ fhandler_socket_unix::getsockopt (int level, int optname, const void *optval,
break;
}
case SO_RCVBUF:
case SO_SNDBUF:
if (*optlen < (socklen_t) sizeof (int))
{
set_errno (EINVAL);
return -1;
}
*(int *) optval = (optname == SO_RCVBUF) ? rmem () : wmem ();
break;
case SO_RCVTIMEO:
case SO_SNDTIMEO:
{