This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: LDT use in LinuxThreads


>>>>> Ulrich Drepper writes:

 > tb@MIT.EDU (Thomas Bushnell, BSG) writes:
>> That's fine; I thought you were talking about checking a compile-time
>> constant.

 > At compile time you provide configure with the minimal supported
 > kernel version and this will be enforced at runtime.  With Andreas'
 > information we can restrict the use of LDT on kernel 2.3.49 and later
 > and enable the feature only if such a kernel is the minimum
 > requirement.

Here's a patch to do so.  Shall I commit it?

Andreas

For linuxthreads:
2000-05-24  Andreas Jaeger  <aj@suse.de>

	* sysdeps/i386/i686/pt-machine.h: Only use LDT on newer kernels.

Normal ChangeLog:
2000-05-24  Andreas Jaeger  <aj@suse.de>

	* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_LDT_WORKS):
	Define it for newer kernels.

============================================================
Index: linuxthreads/sysdeps/i386/i686/pt-machine.h
--- linuxthreads/sysdeps/i386/i686/pt-machine.h	2000/04/27 20:16:31	1.10
+++ linuxthreads/sysdeps/i386/i686/pt-machine.h	2000/05/24 06:47:04
@@ -22,8 +22,8 @@
 #ifndef PT_EI
 # define PT_EI extern inline
 #endif
+#include "kernel-features.h"
 
-
 /* Get some notion of the current stack.  Need not be exactly the top
    of the stack, just something somewhere in the current frame.  */
 #define CURRENT_STACK_FRAME  stack_pointer
@@ -61,6 +61,7 @@
 			: "memory");
   return ret;
 }
-
 
+#if __ASSUME_LDT_WORKS > 0
 #include "../useldt.h"
+#endif
============================================================
Index: sysdeps/unix/sysv/linux/kernel-features.h
--- sysdeps/unix/sysv/linux/kernel-features.h	2000/01/27 23:40:47	1.11
+++ sysdeps/unix/sysv/linux/kernel-features.h	2000/05/24 06:47:04
@@ -117,3 +117,14 @@
 #  define __ASSUME_SETRESUID_SYSCALL	1
 # endif
 #endif
+
+/* We can use the LDTs for threading with Linux 2.3.99 and newer.  */
+#if __LINUX_KERNEL_VERSION >= 131939
+# define __ASSUME_LDT_WORKS		1
+#endif

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]