On Mon, 26 Jul 2021 07:55:00 -0500, Scott Cheloha wrote: > We don't know if it is still in the wild or not. > > There are lots of libc implementations. We can't account for all of > them.
Right. We don't know who is still using a signal or itimer-based sleep. > > Being proscriptive in OpenBSD manual pages isn't going to stop someone > > from creating the precise problem you describe in some other body of > > code. Except, you are saying they don't create that problem. > > Right, we can't prevent it, which is why I wanted to say "beware". POSIX doesn't allow a SIGALRM-based implementation when threads are used anyway. A future version of POSIX will likely make a SIGALRM-based implementation non-conforming event for single-threaded processes. > > So why foam at the mouth over it? > > Because up until this very moment we referenced the historical > implementation approach in the manpage. The 4.4BSD man page had even more detail about this :-) > Anyway, updated patch. No mention of SIGALRM or alarm(3) except in > the History section. I think this is OK for now. > Still wondering whether we need an Errors section to mention that > sleep(3) can set errno. POSIX doesn't define any errors. Of the errors returned by nanosleep, only EINTR is really possible. I guess we could save & restore errno in sleep.c but I don't see any implementations that actually do that. I only checked illumos, glibc and musl though. - todd
