about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-12-15 10:26:23 +0000
committerUlrich Drepper <drepper@redhat.com>2002-12-15 10:26:23 +0000
commit6ee8d3345646ab0bea91891362a2bbf15503edec (patch)
tree718ea6deebec61e44b09eb25817ee5c14da35f57 /nptl
parent2fb6444dbb9672aea7766b3790a3cb70a73473d3 (diff)
downloadglibc-6ee8d3345646ab0bea91891362a2bbf15503edec.tar.gz
glibc-6ee8d3345646ab0bea91891362a2bbf15503edec.tar.xz
glibc-6ee8d3345646ab0bea91891362a2bbf15503edec.zip
Update.
2002-12-15  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/generic/sysdep-cancel.h: Add dummy definitions for
	SINGLE_THREAD_P, LIBC_CANCEL_ASYNC, and LIBC_CANCEL_RESET.

	* sysdeps/unix/sysv/linux/open64.c: New file.

	* sysdeps/generic/pselect.c: Add support for cancellation handling.
	* sysdeps/posix/open64.c: Likewise.
	* sysdeps/posix/sigpause.c: Likewise.
	* sysdeps/posix/sigwait.c: Likewise.
	* sysdeps/posix/system.c: Likewise.
	* sysdeps/posix/waitid.c: Likewise.
	* sysdeps/unix/sysv/linux/accept.S: Likewise.
	* sysdeps/unix/sysv/linux/connect.S: Likewise.
	* sysdeps/unix/sysv/linux/llseek.c: Likewise.
	* sysdeps/unix/sysv/linux/msgrcv.c: Likewise.
	* sysdeps/unix/sysv/linux/msgsnd.c: Likewise.
	* sysdeps/unix/sysv/linux/poll.c: Likewise.
	* sysdeps/unix/sysv/linux/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/readv.c: Likewise.
	* sysdeps/unix/sysv/linux/recv.S: Likewise.
	* sysdeps/unix/sysv/linux/recvfrom.S: Likewise.
	* sysdeps/unix/sysv/linux/recvmsg.S: Likewise.
	* sysdeps/unix/sysv/linux/send.S: Likewise.
	* sysdeps/unix/sysv/linux/sendmsg.S: Likewise.
	* sysdeps/unix/sysv/linux/sendto.S: Likewise.
	* sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.
	* sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.
	* sysdeps/unix/sysv/linux/sigwait.c: Likewise.
	* sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.
	* sysdeps/unix/sysv/linux/tcdrain.c: Likewise.
	* sysdeps/unix/sysv/linux/wait.c: Likewise.
	* sysdeps/unix/sysv/linux/waitpid.c: Likewise.
	* sysdeps/unix/sysv/linux/writev.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/socket.S: Likewise.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog6
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h62
2 files changed, 46 insertions, 22 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 24abd2b541..2296c17803 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,9 @@
+2002-12-15  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
+	SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
+	member of thread decriptor, otherwise return unconditionally 1.
+
 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
index ed9f9420e7..39bdfbea1d 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
+++ b/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
@@ -19,11 +19,14 @@
 
 #include <sysdep.h>
 #include <tls.h>
+#ifndef ASSEMBLER
+# include <nptl/pthreadP.h>
+#endif
 
 #if !defined NOT_IN_libc || defined IS_IN_libpthread
 
-#undef PSEUDO
-#define PSEUDO(name, syscall_name, args)				      \
+# undef PSEUDO
+# define PSEUDO(name, syscall_name, args)				      \
   .text;								      \
   ENTRY (name)								      \
     cmpl $0, %gs:MULTIPLE_THREADS_OFFSET;				      \
@@ -33,7 +36,7 @@
     jae SYSCALL_ERROR_LABEL;						      \
     ret;								      \
   L(pseudo_cancel):							      \
-    call __libc_enable_asynccancel;					      \
+    CENABLE								      \
     SAVE_OLDTYPE_##args							      \
     PUSHARGS_##args							      \
     DOCARGS_##args							      \
@@ -45,26 +48,41 @@
     jae SYSCALL_ERROR_LABEL;						      \
   L(pseudo_end):
 
-#define SAVE_OLDTYPE_0	movl %eax, %ecx;
-#define SAVE_OLDTYPE_1	SAVE_OLDTYPE_0
-#define SAVE_OLDTYPE_2	pushl %eax;
-#define SAVE_OLDTYPE_3	SAVE_OLDTYPE_2
-#define SAVE_OLDTYPE_4	SAVE_OLDTYPE_2
-#define SAVE_OLDTYPE_5	SAVE_OLDTYPE_2
+# define SAVE_OLDTYPE_0	movl %eax, %edx;
+# define SAVE_OLDTYPE_1	SAVE_OLDTYPE_0
+# define SAVE_OLDTYPE_2	pushl %eax;
+# define SAVE_OLDTYPE_3	SAVE_OLDTYPE_2
+# define SAVE_OLDTYPE_4	SAVE_OLDTYPE_2
+# define SAVE_OLDTYPE_5	SAVE_OLDTYPE_2
+
+# define DOCARGS_0	DOARGS_0
+# define DOCARGS_1	DOARGS_1
+# define DOCARGS_2	_DOARGS_2 (12)
+# define DOCARGS_3	_DOARGS_3 (20)
+# define DOCARGS_4	_DOARGS_4 (28)
+# define DOCARGS_5	_DOARGS_5 (36)
+
+# ifdef IS_IN_libpthread
+#  define CENABLE	call __pthread_enable_asynccancel;
+#  define CDISABLE	call __pthread_disable_asynccancel
+# else
+#  define CENABLE	call __libc_enable_asynccancel;
+#  define CDISABLE	call __libc_disable_asynccancel
+# endif
+# define POPCARGS_0	pushl %eax; movl %ecx, %eax; CDISABLE; popl %eax;
+# define POPCARGS_1	POPCARGS_0
+# define POPCARGS_2	xchgl (%esp), %eax; CDISABLE; popl %eax;
+# define POPCARGS_3	POPCARGS_2
+# define POPCARGS_4	POPCARGS_2
+# define POPCARGS_5	POPCARGS_2
+
+# define SINGLE_THREAD_P \
+  __builtin_expect (THREAD_GETMEM (THREAD_SELF,				      \
+				   header.data.multiple_threads) == 0, 1)
 
-#define DOCARGS_0	DOARGS_0
-#define DOCARGS_1	DOARGS_1
-#define DOCARGS_2	_DOARGS_2 (12)
-#define DOCARGS_3	_DOARGS_3 (20)
-#define DOCARGS_4	_DOARGS_4 (28)
-#define DOCARGS_5	_DOARGS_5 (36)
+#else
 
-#define DISABLE		call __libc_disable_asynccancel
-#define POPCARGS_0	pushl %eax; movl %ecx, %eax; DISABLE; popl %eax;
-#define POPCARGS_1	POPCARGS_0
-#define POPCARGS_2	xchgl (%esp), %eax; DISABLE; popl %eax;
-#define POPCARGS_3	POPCARGS_2
-#define POPCARGS_4	POPCARGS_2
-#define POPCARGS_5	POPCARGS_2
+/* This code should never be used but we define it anyhow.  */
+# define SINGLE_THREAD_P (1)
 
 #endif