about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/init-first.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-03-14 11:20:23 +0000
committerRoland McGrath <roland@gnu.org>1996-03-14 11:20:23 +0000
commit8d71c7b0e4f76dce251a121e07dff8212bed73f8 (patch)
treea90fd3140fbd2922cb6006150f8a89f4be0c888d /sysdeps/unix/sysv/linux/init-first.c
parent52e9a9d1187e1a2a7357f3a0f353058e14667d62 (diff)
downloadglibc-8d71c7b0e4f76dce251a121e07dff8212bed73f8.tar.gz
glibc-8d71c7b0e4f76dce251a121e07dff8212bed73f8.tar.xz
glibc-8d71c7b0e4f76dce251a121e07dff8212bed73f8.zip
Thu Mar 14 06:01:07 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
	* string/strnlen.c: New file.
	* string/Makefile (routines): Add strnlen.
	* string/string.h [__USE_GNU] (strnlen): Declare new function.
	[__OPTIMIZE__]: Define extern inline implementation of it.
Diffstat (limited to 'sysdeps/unix/sysv/linux/init-first.c')
-rw-r--r--sysdeps/unix/sysv/linux/init-first.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/sysdeps/unix/sysv/linux/init-first.c b/sysdeps/unix/sysv/linux/init-first.c
index 9d7774a19e..6d974ea1e6 100644
--- a/sysdeps/unix/sysv/linux/init-first.c
+++ b/sysdeps/unix/sysv/linux/init-first.c
@@ -32,22 +32,18 @@ extern void __libc_global_ctors (void);
 static void
 init (int *data)
 {
+  extern int __personality (int);
+
   int argc = *data;
   char **argv = (void *) (data + 1);
   char **envp = &argv[argc + 1];
 
-#ifdef __i386__
-  /* Make sure we are not using the iBSC2 personality.  The `personality'
-     syscall takes one argument; zero means the Linux personality.  The
-     argument arrives in %ebx; we have to save and restore %ebx by hand
-     here, because GCC (as of 2.7.0) cannot handle saving and restoring it
-     for us when it is the dedicated GOT register for PIC.  */
-  asm ("pushl %%ebx\n"
-       "xorl %%ebx, %%ebx\n"
-       "int $0x80 # syscall no %0\n"
-       "popl %%ebx"
-       : : "a" (SYS_ify (personality)));
-#endif
+  /* The `personality' system call takes one argument that chooses the
+     "personality", i.e. the set of system calls and such.  Zero is the
+     native Linux value; we must make this call first thing to disable
+     emulation of some other system that might have been enabled by default
+     based on the executable format.  */
+  __personality (0);
 
   /* Set the FPU control word to the proper default value.  */
   __setfpucw (__fpu_control);