Cygwin: fhandler_socket: Add derived fcntl methods

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2018-02-22 16:37:12 +01:00
parent 79598f94f7
commit 9c593d9b39
4 changed files with 57 additions and 14 deletions

View File

@ -1285,3 +1285,29 @@ fhandler_socket_inet::ioctl (unsigned int cmd, void *p)
syscall_printf ("%d = ioctl_socket(%x, %p)", res, cmd, p);
return res;
}
int
fhandler_socket_inet::fcntl (int cmd, intptr_t arg)
{
int res = 0;
switch (cmd)
{
case F_SETOWN:
{
pid_t pid = (pid_t) arg;
LOCK_EVENTS;
wsock_events->owner = pid;
UNLOCK_EVENTS;
debug_printf ("owner set to %d", pid);
}
break;
case F_GETOWN:
res = wsock_events->owner;
break;
default:
res = fhandler_socket::fcntl (cmd, arg);
break;
}
return res;
}