mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Update.
This commit is contained in:
@ -1,9 +1,5 @@
|
|||||||
2003-06-06 Ulrich Drepper <drepper@redhat.com>
|
2003-06-06 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/sleep.c (__sleep): Use nanosleep syscall
|
|
||||||
directly to avoid cancellation in the regular nanosleep
|
|
||||||
implementation.
|
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/i386/sysdep.h (ASMFMT_2): Only allow
|
* sysdeps/unix/sysv/linux/i386/sysdep.h (ASMFMT_2): Only allow
|
||||||
%edx for first parameter. This means no pushl and therefore the
|
%edx for first parameter. This means no pushl and therefore the
|
||||||
unwind info isn't screwed up.
|
unwind info isn't screwed up.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Implementation of the POSIX sleep function using nanosleep.
|
/* Implementation of the POSIX sleep function using nanosleep.
|
||||||
Copyright (C) 1996, 1997, 1998, 1999, 2003 Free Software Foundation, Inc.
|
Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||||
|
|
||||||
@ -24,12 +24,8 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
/* We are going to use the `nanosleep' syscall of the kernel. But the
|
/* We are going to use the `nanosleep' syscall of the kernel. But the
|
||||||
kernel does not implement the stupid SysV SIGCHLD vs. SIG_IGN
|
kernel does not implement the sstupid SysV SIGCHLD vs. SIG_IGN
|
||||||
behaviour for this syscall. Therefore we have to emulate it here.
|
behaviour for this syscall. Therefore we have to emulate it here. */
|
||||||
|
|
||||||
Also note that we use the syscall directly instead of using the
|
|
||||||
__nanosleep function. The reason is that nanosleep() is a cancellation
|
|
||||||
point while sleep() isn't. */
|
|
||||||
unsigned int
|
unsigned int
|
||||||
__sleep (unsigned int seconds)
|
__sleep (unsigned int seconds)
|
||||||
{
|
{
|
||||||
@ -71,7 +67,7 @@ __sleep (unsigned int seconds)
|
|||||||
if (oact.sa_handler == SIG_IGN)
|
if (oact.sa_handler == SIG_IGN)
|
||||||
{
|
{
|
||||||
/* We should leave SIGCHLD blocked. */
|
/* We should leave SIGCHLD blocked. */
|
||||||
result = INLINE_SYSCALL (nanosleep, 2, &ts, &ts);
|
result = __nanosleep (&ts, &ts);
|
||||||
|
|
||||||
saved_errno = errno;
|
saved_errno = errno;
|
||||||
/* Restore the original signal mask. */
|
/* Restore the original signal mask. */
|
||||||
@ -82,11 +78,11 @@ __sleep (unsigned int seconds)
|
|||||||
{
|
{
|
||||||
/* We should unblock SIGCHLD. Restore the original signal mask. */
|
/* We should unblock SIGCHLD. Restore the original signal mask. */
|
||||||
(void) __sigprocmask (SIG_SETMASK, &oset, (sigset_t *) NULL);
|
(void) __sigprocmask (SIG_SETMASK, &oset, (sigset_t *) NULL);
|
||||||
result = INLINE_SYSCALL (nanosleep, 2, &ts, &ts);
|
result = __nanosleep (&ts, &ts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
result = INLINE_SYSCALL (nanosleep, 2, &ts, &ts);
|
result = __nanosleep (&ts, &ts);
|
||||||
|
|
||||||
if (result != 0)
|
if (result != 0)
|
||||||
/* Round remaining time. */
|
/* Round remaining time. */
|
||||||
|
Reference in New Issue
Block a user