Cygwin: timerfd/signalfd: return EINVAL from write

Linux returns EINVAL, "fd is attached to an object which is unsuitable
for writing".  If we don't handle write locally, write returns EBADF.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2019-01-17 11:51:11 +01:00
parent 173e067a31
commit 7f983079d4
3 changed files with 21 additions and 6 deletions

View File

@@ -49,6 +49,7 @@ fhandler_signalfd::signalfd (const sigset_t *mask, int flags)
nohandle (true);
set_unique_id ();
set_ino (get_unique_id ());
set_flags (O_RDWR | O_BINARY);
}
return 0;
}
@@ -139,6 +140,13 @@ fhandler_signalfd::read (void *ptr, size_t& len)
return;
}
ssize_t __stdcall
fhandler_signalfd::write (const void *, size_t)
{
set_errno (EINVAL);
return -1;
}
/* Called from select */
int
fhandler_signalfd::poll ()