]> Savannah Git Hosting - gnulib.git/commit
nanosleep: simplify by using pselect
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 25 Feb 2022 19:54:49 +0000 (11:54 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 25 Feb 2022 20:28:47 +0000 (12:28 -0800)
commit2510ffcdcdad4e5cd20455b4891de4f5e128072a
tree8c79ede1f9ecd68bc1176816f9ad24d9e1a3f13f
parent23cca8268d21f5d58ed0209002d5673d0518c426
nanosleep: simplify by using pselect

GNU Emacs avoids Gnulib’s ‘select’ module and uses only pselect,
which it implements in a special way on MS-DOS.
Unfortunately, though, nanosleep uses ‘select’;
problem reported by Lars Ingebrigtsen (Bug#32452#74).
As far as I can tell, Gnulib nanosleep's use of
‘select’ with signals is only for ancient platforms
that Gnulib no longer cares about, so remove that use of ‘select’.
I don’t know of any platforms that still need this fallback code,
but just in case, fall back to pselect instead, while removing
signal handling that it shouldn’t be needed nowadays.
* lib/nanosleep.c: Do not include sig-handler.h, sys/time.h.
(SIGCONT, suspended, sighandler, my_usleep): Remove.
(nanosleep) [!HAVE_BUG_BIG_NANOSLEEP && !(_WIN32 && !__CYGWIN__)]:
Just call pselect.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Do not check for sys/time.h
or call gl_FUNC_SELECT.  Do not include sys/time.h or worry
about LIBSOCKET.
(gl_PREREQ_NANOSLEEP): Remove as it’s no longer needed.
All uses removed.
* modules/nanosleep (Depends-on): Add pselect.
Remove select, sigaction, sys_time.
ChangeLog
lib/nanosleep.c
m4/nanosleep.m4
modules/nanosleep