aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-12-14 19:49:13 +0000
committerUlrich Drepper <drepper@redhat.com>2002-12-14 19:49:13 +0000
commit9d263d72848fb561e104a21da3ffccf791078f2a (patch)
treea4004b7cacfaf715a38199cdbb0c4114677c5508
parent36b3f3eb117f2923b1080a22f748e4a6cd63de73 (diff)
downloadglibc-9d263d72848fb561e104a21da3ffccf791078f2a.tar.xz
glibc-9d263d72848fb561e104a21da3ffccf791078f2a.zip
Update.
2002-12-14 Jakub Jelinek <jakub@redhat.com> * dirent/bug-readdir1.c: Include unistd.h.
-rw-r--r--ChangeLog4
-rw-r--r--dirent/bug-readdir1.c1
-rw-r--r--nptl/ChangeLog58
-rw-r--r--nptl/Makefile9
-rw-r--r--nptl/pt-readv.c2
-rw-r--r--nptl/sysdeps/unix/sysv/linux/close.c49
-rw-r--r--nptl/sysdeps/unix/sysv/linux/connect.S6
-rw-r--r--nptl/sysdeps/unix/sysv/linux/creat.c57
-rw-r--r--nptl/sysdeps/unix/sysv/linux/fsync.c47
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/fcntl.c64
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/pt-socket.S29
-rw-r--r--nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c13
-rw-r--r--nptl/sysdeps/unix/sysv/linux/llseek.c68
-rw-r--r--nptl/sysdeps/unix/sysv/linux/lseek.c48
-rw-r--r--nptl/sysdeps/unix/sysv/linux/msgrcv.c73
-rw-r--r--nptl/sysdeps/unix/sysv/linux/msgsnd.c56
-rw-r--r--nptl/sysdeps/unix/sysv/linux/msync.c47
-rw-r--r--nptl/sysdeps/unix/sysv/linux/nanosleep.c48
-rw-r--r--nptl/sysdeps/unix/sysv/linux/open.c62
-rw-r--r--nptl/sysdeps/unix/sysv/linux/open64.c61
-rw-r--r--nptl/sysdeps/unix/sysv/linux/pause.c47
-rw-r--r--nptl/sysdeps/unix/sysv/linux/poll.c59
-rw-r--r--nptl/sysdeps/unix/sysv/linux/pread.c70
-rw-r--r--nptl/sysdeps/unix/sysv/linux/pread64.c71
-rw-r--r--nptl/sysdeps/unix/sysv/linux/pselect.c91
-rw-r--r--nptl/sysdeps/unix/sysv/linux/pwrite.c72
-rw-r--r--nptl/sysdeps/unix/sysv/linux/pwrite64.c73
-rw-r--r--nptl/sysdeps/unix/sysv/linux/readv.c58
-rw-r--r--nptl/sysdeps/unix/sysv/linux/recv.S5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/recvfrom.S5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/recvmsg.S5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/select.c57
-rw-r--r--nptl/sysdeps/unix/sysv/linux/send.S6
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sendmsg.S5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sendto.S5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sigpause.c100
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sigsuspend.c57
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sigtimedwait.c62
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sigwait.c91
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sigwaitinfo.c64
-rw-r--r--nptl/sysdeps/unix/sysv/linux/system.c209
-rw-r--r--nptl/sysdeps/unix/sysv/linux/tcdrain.c46
-rw-r--r--nptl/sysdeps/unix/sysv/linux/wait.c52
-rw-r--r--nptl/sysdeps/unix/sysv/linux/waitid.c145
-rw-r--r--nptl/sysdeps/unix/sysv/linux/waitpid.c47
-rw-r--r--nptl/sysdeps/unix/sysv/linux/writev.c58
-rw-r--r--nptl/tst-cancel5.c1
-rw-r--r--nptl/tst-cleanup1.c1
48 files changed, 2360 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a54e8e15b0..9994a04665 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-12-14 Jakub Jelinek <jakub@redhat.com>
+
+ * dirent/bug-readdir1.c: Include unistd.h.
+
2002-12-13 Jakub Jelinek <jakub@redhat.com>
* locale/programs/locale.c: Include locarchive.h.
diff --git a/dirent/bug-readdir1.c b/dirent/bug-readdir1.c
index 1f70722dd2..4c3521dbb5 100644
--- a/dirent/bug-readdir1.c
+++ b/dirent/bug-readdir1.c
@@ -3,6 +3,7 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include <sys/types.h>
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index d211cab835..5650b3825a 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,61 @@
+2002-12-14 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
+ element in TCB to see whether locking is needed.
+
+ * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
+ MULTIPLE_THREADS_OFFSET value is correct.
+
+ * sysdeps/unix/sysv/linux/close.c: New file.
+ * sysdeps/unix/sysv/linux/connect.S: New file.
+ * sysdeps/unix/sysv/linux/creat.c: New file.
+ * sysdeps/unix/sysv/linux/fsync.c: New file.
+ * sysdeps/unix/sysv/linux/llseek.c: New file.
+ * sysdeps/unix/sysv/linux/lseek.c: New file.
+ * sysdeps/unix/sysv/linux/msgrcv.c: New file.
+ * sysdeps/unix/sysv/linux/msgsnd.c: New file.
+ * sysdeps/unix/sysv/linux/msync.c: New file.
+ * sysdeps/unix/sysv/linux/nanosleep.c: New file.
+ * sysdeps/unix/sysv/linux/open.c: New file.
+ * sysdeps/unix/sysv/linux/open64.c: New file.
+ * sysdeps/unix/sysv/linux/pause.c: New file.
+ * sysdeps/unix/sysv/linux/poll.c: New file.
+ * sysdeps/unix/sysv/linux/pread.c: New file.
+ * sysdeps/unix/sysv/linux/pread64.c: New file.
+ * sysdeps/unix/sysv/linux/pselect.c: New file.
+ * sysdeps/unix/sysv/linux/pwrite.c: New file.
+ * sysdeps/unix/sysv/linux/pwrite64.c: New file.
+ * sysdeps/unix/sysv/linux/readv.c: New file.
+ * sysdeps/unix/sysv/linux/recv.S: New file.
+ * sysdeps/unix/sysv/linux/recvfrom.S: New file.
+ * sysdeps/unix/sysv/linux/recvmsg.S: New file.
+ * sysdeps/unix/sysv/linux/select.c: New file.
+ * sysdeps/unix/sysv/linux/send.S: New file.
+ * sysdeps/unix/sysv/linux/sendmsg.S: New file.
+ * sysdeps/unix/sysv/linux/sendto.S: New file.
+ * sysdeps/unix/sysv/linux/sigpause.c: New file.
+ * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
+ * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
+ * sysdeps/unix/sysv/linux/sigwait.c: New file.
+ * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
+ * sysdeps/unix/sysv/linux/system.c: New file.
+ * sysdeps/unix/sysv/linux/tcdrain.c: New file.
+ * sysdeps/unix/sysv/linux/wait.c: New file.
+ * sysdeps/unix/sysv/linux/waitid.c: New file.
+ * sysdeps/unix/sysv/linux/waitpid.c: New file.
+ * sysdeps/unix/sysv/linux/writev.c: New file.
+ * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
+
+ * pt-readv.c: Fix comment.
+
+2002-12-14 Jakub Jelinek <jakub@redhat.com>
+
+ * tst-cleanup1.c: Include stdlib.h.
+
+ * tst-cancel5.c: New test.
+ * Makefile (tests): Add tst-cancel5.
+ (tst-cancel5): Link against libc.so libpthread.so in that order.
+
2002-12-13 Ulrich Drepper <drepper@redhat.com>
* forward.c (test_loaded): Prevent recursive calls.
diff --git a/nptl/Makefile b/nptl/Makefile
index 029d376196..71680d8792 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -126,7 +126,7 @@ tests = tst-mutex1 tst-mutex2 tst-mutex3 tst-mutex4 tst-mutex5 tst-mutex6 \
tst-tsd1 tst-tsd2 \
tst-fork1 tst-fork2 tst-fork3 \
tst-atfork1 \
- tst-cancel1 tst-cancel2 tst-cancel3 tst-cancel4 \
+ tst-cancel1 tst-cancel2 tst-cancel3 tst-cancel4 tst-cancel5 \
tst-cleanup1 \
tst-flock1 tst-flock2 \
tst-signal1 tst-signal2 tst-signal3 \
@@ -164,6 +164,8 @@ CFLAGS-funlockfile.c = -D_IO_MTSAFE_IO
ifeq ($(build-static),yes)
tests-static += tst-locale1 tst-locale2
endif
+# These tests are linked with libc before libpthread
+tests-reverse += tst-cancel5
include ../Rules
@@ -205,10 +207,13 @@ $(objpfx)libpthread.so: $(common-objpfx)libc.so \
# Make sure we link with the thread library.
ifeq ($(build-shared),yes)
$(addprefix $(objpfx), \
- $(filter-out $(tests-static), \
+ $(filter-out $(tests-static) $(tests-reverse), \
$(tests) $(test-srcs))): $(objpfx)libpthread.so \
$(objpfx)libpthread_nonshared.a
$(objpfx)tst-unload: $(common-objpfx)dlfcn/libdl.so
+$(addprefix $(objpfx), $(tests-reverse)): \
+ $(common-objpfx)libc.so $(objpfx)libpthread.so \
+ $(objpfx)libpthread_nonshared.a
$(addprefix $(objpfx),$(tests-static)): $(objpfx)libpthread.a
else
$(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a
diff --git a/nptl/pt-readv.c b/nptl/pt-readv.c
index e81c8306a1..dc22df82da 100644
--- a/nptl/pt-readv.c
+++ b/nptl/pt-readv.c
@@ -24,7 +24,7 @@
#include "pthreadP.h"
-/* Not all versions of the kernel support extremely the large number
+/* Not all versions of the kernel support extremely large numbers
of records. */
#ifndef UIO_FASTIOV
/* 1024 is what the kernels with NPTL support use. */
diff --git a/nptl/sysdeps/unix/sysv/linux/close.c b/nptl/sysdeps/unix/sysv/linux/close.c
new file mode 100644
index 0000000000..e5cac953f3
--- /dev/null
+++ b/nptl/sysdeps/unix/sysv/linux/close.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <sysdep.h>
+#include <unistd.h>
+#include <nptl/pthreadP.h>
+#include <tls.h>
+
+
+int
+__libc_close (int fd)
+{
+#ifndef NOT_IN_libc
+ if (__builtin_expect (THREAD_GETMEM (THREAD_SELF,
+ header.data.multiple_threads) == 0, 1))
+ return INLINE_SYSCALL (close, 1, fd);
+
+ int oldtype = LIBC_CANCEL_ASYNC ();
+#endif
+
+ int result = INLINE_SYSCALL (close, 1, fd);
+
+#ifndef NOT_IN_libc
+ LIBC_CANCEL_RESET (oldtype);
+#endif
+
+ return result;
+}
+strong_alias (__libc_close, __close)
+libc_hidden_weak (__close)
+weak_alias (__libc_close, close)
diff --git a/nptl/sysdeps/unix/sysv/linux/connect.S b/nptl/sysdeps/unix/sysv/linux/connect.S
new file mode 100644
index 0000000000..ce6a038fa5
--- /dev/null
+++ b/nptl/sysdeps/unix/sysv/linux/connect.S
@@ -0,0 +1,6 @@
+#define socket connect
+#define __socket __libc_connect
+#define NARGS 3
+#include <pt-socket.S>
+strong_alias (__libc_connect, __connect_internal)
+weak_alias (__libc_connect, __connect)
diff --git a/nptl/sysdeps/unix/sysv/linux/creat.c b/nptl/sysdeps/unix/sysv/linux/creat.c
new file mode 100644
index 0000000000..c21c8bb9a4
--- /dev/null
+++ b/nptl/sysdeps/unix/sysv/linux/creat.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <sysdep.h>
+#include <unistd.h>
+#include <nptl/pthreadP.h>
+#include <tls.h>
+
+
+int
+creat (const char *pathname, mode_t mode)
+{
+#ifndef NOT_IN_libc
+ if (__builtin_expect (THREAD_GETMEM (THREAD_SELF,
+ header.data.multiple_threads) == 0, 1))
+ {
+#ifdef __NR_creat
+ return INLINE_SYSCALL (creat, 2, pathname, mode);
+#else
+ return __libc_open (pathname, O_WRONLY|O_CREAT|O_TRUNC, mode);
+#endif
+ }
+
+ int oldtype = LIBC_CANCEL_ASYNC ();
+#endif
+
+#ifdef __NR_creat
+ int result = INLINE_SYSCALL (creat, 2, pathname, mode);
+#else
+ int result = __libc_open (pathname, O_WRONLY|O_CREAT|O_TRUNC, mode);
+#endif
+
+#ifndef NOT_IN_libc
+ LIBC_CANCEL_RESET (oldtype);
+#endif
+
+ return result;
+}
diff --git a/nptl/sysdeps/unix/sysv/linux/fsync.c b/nptl/sysdeps/unix/sysv/linux/fsync.c
new file mode 100644
index 0000000000..b132a75ee9
--- /dev/null
+++ b/nptl/sysdeps/unix/sysv/linux/fsync.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <sysdep.h>
+#include <unistd.h>
+#include <nptl/pthreadP.h>
+#include <tls.h>
+
+
+int
+__libc_fsync (int fd)
+{
+#ifndef NOT_IN_libc
+ if (__builtin_expect (THREAD_GETMEM (THREAD_SELF,
+ header.data.multiple_threads) == 0, 1))
+ return INLINE_SYSCALL (fsync, 1, fd);
+
+ int oldtype = LIBC_CANCEL_ASYNC ();
+#endif
+
+ int result = INLINE_SYSCALL (fsync, 1, fd);
+
+#ifndef NOT_IN_libc
+ LIBC_CANCEL_RESET (oldtype);
+#endif
+
+ return result;
+}
+weak_alias (__libc_fsync, fsync)
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/fcntl.c b/nptl/sysdeps/unix/sysv/linux/i386/fcntl.c
new file mode 100644
index 0000000000..89b8