Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Apr 2001 17:59:53 -0700
From:      "Jonathan Graehl" <jonathan@graehl.org>
To:        "Freebsd-Net" <freebsd-net@freebsd.org>
Cc:        "Jonathan Lemon" <jlemon@freebsd.org>
Subject:   please document that kevent does not automatically restart when interrupted by signals
Message-ID:  <NCBBLOALCKKINBNNEDDLEEKNDNAA.jonathan@graehl.org>

next in thread | raw e-mail | index | archive | help
It is my understanding that an unmasked signal will always interrupt a call to
kevent, even if SA_RESTART is specified in sigaction, or siginterrupt(signo, 0)
is used.

Can this be officially documented so that it can be relied upon?  I want signals
to interrupt kevent; I would like to be able to use SA_RESTART so that I don't
have to check for an EINTR except from kevent, but I wouldn't want kevent
restarted for me should the implementation change out from under me.

Other signal interrupt / restart questions:

Can a signal ever interrupt a (nonblocking) datagram write/read (possibly
truncating a datagram due to a partial read/write count)?  (my guess: not unless
you're sleeping awaiting a datagram with a blocking read)  Is this behavior
documented?

Can a signal ever interrupt an I/O on a nonblocking fd, such that the I/O will
return EINTR rather than EAGAIN or a partial success?  (my guess: no, I don't
need to check for EINTR for nonblocking fds even if I siginterrupt(signo, 1))
Is this documented?

I currently use SA_RESTART, assume that EINTR will never be returned, except I
expect EINTR to be returned immediately by kevent so I can get my signal and
process it in a synchronous fashion outside of my event handling logic.  Relying
on undocumented behavior makes me nervous.  Are there any other system calls I
should worry about returning EINTR even when I specify SA_RESTART?

Thanks,
--
Jonathan Graehl
  http://jonathan.graehl.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?NCBBLOALCKKINBNNEDDLEEKNDNAA.jonathan>