aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-08-14 00:14:43 +0000
committerUlrich Drepper <drepper@redhat.com>2003-08-14 00:14:43 +0000
commitb61c8aba800959edfa405adb8c8a6f2f371633dd (patch)
tree069feb707f6ba359262e49b97c419654b2de597c
parentbbdef797baaddf4c85163832972fd0140cad964d (diff)
downloadglibc-b61c8aba800959edfa405adb8c8a6f2f371633dd.zip
glibc-b61c8aba800959edfa405adb8c8a6f2f371633dd.tar.gz
glibc-b61c8aba800959edfa405adb8c8a6f2f371633dd.tar.bz2
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.
-rw-r--r--ChangeLog19
-rw-r--r--elf/Makefile13
-rw-r--r--linuxthreads/ChangeLog5
-rw-r--r--linuxthreads/sysdeps/pthread/Makefile1
-rw-r--r--stdio-common/vfprintf.c4
-rw-r--r--stdio-common/vfscanf.c2
-rw-r--r--sysdeps/pthread/aio_misc.c4
-rw-r--r--sysdeps/pthread/aio_misc.h9
-rw-r--r--sysdeps/pthread/aio_notify.c22
-rw-r--r--sysdeps/pthread/aio_suspend.c2
-rw-r--r--sysdeps/pthread/lio_listio.c12
-rw-r--r--sysdeps/unix/sysv/linux/i386/syscalls.list1
12 files changed, 83 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index f1ed43c..c00f40a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+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.
+
2003-08-12 Jakub Jelinek <jakub@redhat.com>
* libio/libioP.h (_IO_vtable_offset): Define.
diff --git a/elf/Makefile b/elf/Makefile
index 66419be..7554962 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -221,13 +221,15 @@ $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a
mv -f $@T $@
$(objpfx)librtld.mk: $(objpfx)librtld.map Makefile
+ LC_ALL=C \
sed -n 's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
$< | \
while read lib file; do \
case $$lib in \
libc_pic.a) \
- fgrep -l /$$file \
+ LC_ALL=C fgrep -l /$$file \
$(common-objpfx)stamp.os $(common-objpfx)*/stamp.os | \
+ LC_ALL=C \
sed 's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
;; \
*/*.a) \
@@ -235,8 +237,8 @@ $(objpfx)librtld.mk: $(objpfx)librtld.map Makefile
*) echo "Wasn't expecting $$lib($$file)" >&2; exit 1 ;; \
esac; \
done > $@T
- echo rtld-subdirs = `sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
- | sort -u` >> $@T
+ echo rtld-subdirs = `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
+ | LC_ALL=C sort -u` >> $@T
mv -f $@T $@
$(objpfx)rtld-libc.a: $(objpfx)librtld.mk FORCE
@@ -251,6 +253,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
@rm -f $@.lds
$(LINK.o) -nostdlib -nostartfiles -shared \
$(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 | \
+ LC_ALL=C \
sed -e '/^=========/,/^=========/!d;/^=========/d' \
-e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
> $@.lds
@@ -317,11 +320,11 @@ endif
ifeq ($(ldd-rewrite-script),no)
define gen-ldd
-sed $($(ldd-shell)-ldd-rewrite) < $< > $@.new
+LC_ALL=C sed $($(ldd-shell)-ldd-rewrite) < $< > $@.new
endef
else
define gen-ldd
-sed $($(ldd-shell)-ldd-rewrite) < $< | sed -f $(ldd-rewrite-script) > $@.new
+LC_ALL=C sed $($(ldd-shell)-ldd-rewrite) < $< | LC_ALL=C sed -f $(ldd-rewrite-script) > $@.new
endef
endif
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 1fbaa1c..148bc73 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-13 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/pthread/Makefile [subdir=rt] (CPPFLAGS): Add
+ -DBROKEN_THREAD_SIGNALS.
+
2003-08-11 Steven Munroe <sjmunroe@us.ibm.com>
* manager.c (pthread_start_thread) [!(USE_TLS && HAVE___THREAD)]:
diff --git a/linuxthreads/sysdeps/pthread/Makefile b/linuxthreads/sysdeps/pthread/Makefile
index e9d57d5..f73f40e 100644
--- a/linuxthreads/sysdeps/pthread/Makefile
+++ b/linuxthreads/sysdeps/pthread/Makefile
@@ -1,5 +1,6 @@
ifeq ($(subdir),rt)
librt-sysdep_routines += timer_routines
+CPPFLAGS += -DBROKEN_THREAD_SIGNALS
ifeq (yes,$(build-shared))
$(objpfx)tst-timer: $(objpfx)librt.so $(shared-thread-library)
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 16f280e..bcff971 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -78,7 +78,7 @@
if (width > 0) \
done += INTUSE(_IO_padn) (s, (Padchar), width)
# define PUTC(C, F) _IO_putc_unlocked (C, F)
-# define ORIENT if (s->_vtable_offset == 0 && _IO_fwide (s, -1) != -1)\
+# define ORIENT if (_IO_vtable_offset (s) == 0 && _IO_fwide (s, -1) != -1)\
return -1
# else
# define vfprintf _IO_vfwprintf
@@ -1267,7 +1267,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
/* Check for correct orientation. */
if (
# ifdef USE_IN_LIBIO
- s->_vtable_offset == 0 &&
+ _IO_vtable_offset (s) == 0 &&
# endif
_IO_fwide (s, sizeof (CHAR_T) == 1 ? -1 : 1)
!= (sizeof (CHAR_T) == 1 ? -1 : 1))
diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
index 8f8c99a..4f6a531 100644
--- a/stdio-common/vfscanf.c
+++ b/stdio-common/vfscanf.c
@@ -120,7 +120,7 @@
# define ISDIGIT(Ch) isdigit (Ch)
# define ISXDIGIT(Ch) isxdigit (Ch)
# define TOLOWER(Ch) tolower (Ch)
-# define ORIENT if (s->_vtable_offset == 0 \
+# define ORIENT if (_IO_vtable_offset (s) == 0 \
&& _IO_fwide (s, -1) != -1) \
return EOF
diff --git a/sysdeps/pthread/aio_misc.c b/sysdeps/pthread/aio_misc.c
index 78cf764..c2eb674 100644
--- a/sysdeps/pthread/aio_misc.c
+++ b/sysdeps/pthread/aio_misc.c
@@ -1,5 +1,5 @@
/* Handle general operations.
- Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,1999,2000,2001,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -328,8 +328,10 @@ __aio_enqueue_request (aiocb_union *aiocbp, int operation)
return NULL;
}
newp->aiocbp = aiocbp;
+#ifdef BROKEN_THREAD_SIGNALS
newp->caller_pid = (aiocbp->aiocb.aio_sigevent.sigev_notify == SIGEV_SIGNAL
? getpid () : 0);
+#endif
newp->waiting = NULL;
aiocbp->aiocb.__abs_prio = prio;
diff --git a/sysdeps/pthread/aio_misc.h b/sysdeps/pthread/aio_misc.h
index 05e60e7..44d53b0 100644
--- a/sysdeps/pthread/aio_misc.h
+++ b/sysdeps/pthread/aio_misc.h
@@ -50,9 +50,11 @@ struct waitlist
volatile int *counterp;
/* The next field is used in asynchronous `lio_listio' operations. */
struct sigevent *sigevp;
+#ifdef BROKEN_THREAD_SIGNALS
/* XXX See requestlist, it's used to work around the broken signal
handling in Linux. */
pid_t caller_pid;
+#endif
};
@@ -80,9 +82,11 @@ struct requestlist
/* Pointer to the actual data. */
aiocb_union *aiocbp;
+#ifdef BROKEN_THREAD_SIGNALS
/* PID of the initiator thread.
XXX This is only necessary for the broken signal handling on Linux. */
pid_t caller_pid;
+#endif
/* List of waiting processes. */
struct waitlist *waiting;
@@ -120,8 +124,13 @@ extern void __aio_notify (struct requestlist *req)
attribute_hidden internal_function;
/* Notify initiator of request. */
+#ifdef BROKEN_THREAD_SIGNALS
extern int __aio_notify_only (struct sigevent *sigev, pid_t caller_pid)
attribute_hidden internal_function;
+#else
+extern int __aio_notify_only (struct sigevent *sigev)
+ attribute_hidden internal_function;
+#endif
/* Send the signal. */
extern int __aio_sigqueue (int sig, const union sigval val, pid_t caller_pid)
diff --git a/sysdeps/pthread/aio_notify.c b/sysdeps/pthread/aio_notify.c
index 047b631..d1c0a63 100644
--- a/sysdeps/pthread/aio_notify.c
+++ b/sysdeps/pthread/aio_notify.c
@@ -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);
diff --git a/sysdeps/pthread/aio_suspend.c b/sysdeps/pthread/aio_suspend.c
index 8bc8f0e..207dad9 100644
--- a/sysdeps/pthread/aio_suspend.c
+++ b/sysdeps/pthread/aio_suspend.c
@@ -115,7 +115,9 @@ aio_suspend (list, nent, timeout)
waitlist[cnt].next = requestlist[cnt]->waiting;
waitlist[cnt].counterp = &dummy;
waitlist[cnt].sigevp = NULL;
+#ifdef BROKEN_THREAD_SIGNALS
waitlist[cnt].caller_pid = 0; /* Not needed. */
+#endif
requestlist[cnt]->waiting = &waitlist[cnt];
any = true;
}
diff --git a/sysdeps/pthread/lio_listio.c b/sysdeps/pthread/lio_listio.c
index 0ea3d92..5b98837 100644
--- a/sysdeps/pthread/lio_listio.c
+++ b/sysdeps/pthread/lio_listio.c
@@ -100,8 +100,14 @@ lio_listio (mode, list, nent, sig)
pthread_mutex_unlock (&__aio_requests_mutex);
if (mode == LIO_NOWAIT)
+ {
+#ifdef BROKEN_THREAD_SIGNALS
__aio_notify_only (sig,
sig->sigev_notify == SIGEV_SIGNAL ? getpid () : 0);
+#else
+ __aio_notify_only (sig);
+#endif
+ }
return result;
}
@@ -122,7 +128,9 @@ lio_listio (mode, list, nent, sig)
waitlist[cnt].next = requests[cnt]->waiting;
waitlist[cnt].counterp = &total;
waitlist[cnt].sigevp = NULL;
+#ifdef BROKEN_THREAD_SIGNALS
waitlist[cnt].caller_pid = 0; /* Not needed. */
+#endif
requests[cnt]->waiting = &waitlist[cnt];
++total;
}
@@ -159,7 +167,9 @@ lio_listio (mode, list, nent, sig)
}
else
{
+#ifdef BROKEN_THREAD_SIGNALS
pid_t caller_pid = sig->sigev_notify == SIGEV_SIGNAL ? getpid () : 0;
+#endif
total = 0;
for (cnt = 0; cnt < nent; ++cnt)
@@ -173,7 +183,9 @@ lio_listio (mode, list, nent, sig)
waitlist->list[cnt].next = requests[cnt]->waiting;
waitlist->list[cnt].counterp = &waitlist->counter;
waitlist->list[cnt].sigevp = &waitlist->sigev;
+#ifdef BROKEN_THREAD_SIGNALS
waitlist->list[cnt].caller_pid = caller_pid;
+#endif
requests[cnt]->waiting = &waitlist->list[cnt];
++total;
}
diff --git a/sysdeps/unix/sysv/linux/i386/syscalls.list b/sysdeps/unix/sysv/linux/i386/syscalls.list
index f87c4f7..2a8c1d8 100644
--- a/sysdeps/unix/sysv/linux/i386/syscalls.list
+++ b/sysdeps/unix/sysv/linux/i386/syscalls.list
@@ -4,3 +4,4 @@ modify_ldt EXTRA modify_ldt i:ipi __modify_ldt modify_ldt
vm86 - vm86 i:p __vm86 vm86
oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0
+time - time Ei:p time