Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove signal handling for nanosleep (bug 16364)
Linux 2.6.32 and forward do not show the issue regarding SysV SIGCHLD
vs. SIG_IGN for nanosleep which make it feasible to use it for sleep
implementation without requiring any hacking to handle the spurious
wake up.  The issue is likely being fixed before 2.6 and git
history [1] [2].

This patch simplifies the sleep code to call nanosleep directly by
using the posix default version.  It also removes the early cancellation
tests for zero argument, since nanosleep will handle cancellation
in this case.

[1] https://lkml.org/lkml/2004/11/25/5
[2] https://lkml.org/lkml/2003/11/8/50

Checked on x86_64, ppc64le, and aarch64.

	[BZ #16364]
	* sysdeps/unix/sysv/linux/sleep.c: Remove file
	* sysdeps/posix/sleep.c (__sleep): Simplify cancellation handling.
  • Loading branch information
Adhemerval Zanella authored and Adhemerval Zanella committed Nov 20, 2015
1 parent 31cf394 commit 8c873bf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 158 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
@@ -1,3 +1,9 @@
2015-11-20 Adhemerval Zanella <adhemerval.zanella@linaro.org>

[BZ #16364]
* sysdeps/unix/sysv/linux/sleep.c: Remove file.
* sysdeps/posix/sleep.c (__sleep): Simplify cancellation handling.

2015-11-20 Stefan Liebler <stli@linux.vnet.ibm.com>

* sysdeps/s390/fpu/bits/mathinline.h:
Expand Down
9 changes: 0 additions & 9 deletions sysdeps/posix/sleep.c
Expand Up @@ -32,15 +32,6 @@
unsigned int
__sleep (unsigned int seconds)
{
/* This is not necessary but some buggy programs depend on it. */
if (__glibc_unlikely (seconds == 0))
{
#ifdef CANCELLATION_P
CANCELLATION_P (THREAD_SELF);
#endif
return 0;
}

int save_errno = errno;

const unsigned int max
Expand Down
149 changes: 0 additions & 149 deletions sysdeps/unix/sysv/linux/sleep.c

This file was deleted.

0 comments on commit 8c873bf

Please sign in to comment.