mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
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.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user