mirror of
https://sourceware.org/git/glibc.git
synced 2026-01-06 11:51:29 +03:00
Update.
2003-08-13 Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/sysv/linux/i386/syscalls.list: Add time syscall. * elf/Makefile: Use LC_ALL=C in a few cases where we call external text processing tools. * sysdeps/pthread/aio_misc.h (struct waitlist): Don't add caller_pid element unless BROKEN_THREAD_SIGNALS is defined. (struct requestlist): Likewise. * sysdeps/pthread/aio_misc.c (__aio_enqueue_request): Don't fill in caller_pid of new request unless BROKEN_THREAD_SIGNALS is defined. * sysdeps/pthread/aio_suspend.c (aio_suspend): Likewise. * sysdeps/pthread/aio_notify.c (__aio_notify_only): Remove caller_pid parameter unless BROKEN_THREAD_SIGNALS is defined. Adjust callers. Pass current PID to __aio_sigqueue. * sysdeps/pthread/lio_listio.c (lio_listio): Adjust __aio_notify_only call. Don't initialize caller_pid field of waitlist element.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* Notify initiator of AIO request.
|
||||
Copyright (C) 1997,98,99,2000,01 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997,98,99,2000,2001,2003 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
@@ -45,12 +45,16 @@ notify_func_wrapper (void *arg)
|
||||
|
||||
int
|
||||
internal_function
|
||||
#ifdef BROKEN_THREAD_SIGNALS
|
||||
__aio_notify_only (struct sigevent *sigev, pid_t caller_pid)
|
||||
#else
|
||||
__aio_notify_only (struct sigevent *sigev)
|
||||
#endif
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
/* Send the signal to notify about finished processing of the request. */
|
||||
if (sigev->sigev_notify == SIGEV_THREAD)
|
||||
if (__builtin_expect (sigev->sigev_notify == SIGEV_THREAD, 0))
|
||||
{
|
||||
/* We have to start a thread. */
|
||||
pthread_t tid;
|
||||
@@ -91,9 +95,15 @@ __aio_notify_only (struct sigevent *sigev, pid_t caller_pid)
|
||||
#if _POSIX_REALTIME_SIGNALS
|
||||
/* Note that the standard gives us the option of using a plain
|
||||
non-queuing signal here when SA_SIGINFO is not set for the signal. */
|
||||
# ifdef BROKEN_THREAD_SIGNALS
|
||||
if (__aio_sigqueue (sigev->sigev_signo, sigev->sigev_value, caller_pid)
|
||||
< 0)
|
||||
result = -1;
|
||||
# else
|
||||
if (__aio_sigqueue (sigev->sigev_signo, sigev->sigev_value, getpid ())
|
||||
< 0)
|
||||
result = -1;
|
||||
# endif
|
||||
#else
|
||||
/* There are no queued signals on this system at all. */
|
||||
result = raise (sigev->sigev_signo);
|
||||
@@ -111,7 +121,11 @@ __aio_notify (struct requestlist *req)
|
||||
struct waitlist *waitlist;
|
||||
struct aiocb *aiocbp = &req->aiocbp->aiocb;
|
||||
|
||||
#ifdef BROKEN_THREAD_SIGNALS
|
||||
if (__aio_notify_only (&aiocbp->aio_sigevent, req->caller_pid) != 0)
|
||||
#else
|
||||
if (__aio_notify_only (&aiocbp->aio_sigevent) != 0)
|
||||
#endif
|
||||
{
|
||||
/* XXX What shall we do if already an error is set by
|
||||
read/write/fsync? */
|
||||
@@ -135,7 +149,11 @@ __aio_notify (struct requestlist *req)
|
||||
this request is the last one, send the signal. */
|
||||
if (*waitlist->counterp == 0)
|
||||
{
|
||||
#ifdef BROKEN_THREAD_SIGNALS
|
||||
__aio_notify_only (waitlist->sigevp, waitlist->caller_pid);
|
||||
#else
|
||||
__aio_notify_only (waitlist->sigevp);
|
||||
#endif
|
||||
/* This is tricky. See lio_listio.c for the reason why
|
||||
this works. */
|
||||
free ((void *) waitlist->counterp);
|
||||
|
||||
Reference in New Issue
Block a user