diff options
Diffstat (limited to 'libc/sysdeps/linux/i386/brk.c')
-rw-r--r-- | libc/sysdeps/linux/i386/brk.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libc/sysdeps/linux/i386/brk.c b/libc/sysdeps/linux/i386/brk.c index 5790e2fca..6a654f0d0 100644 --- a/libc/sysdeps/linux/i386/brk.c +++ b/libc/sysdeps/linux/i386/brk.c @@ -21,15 +21,19 @@ #include <unistd.h> #include <sys/syscall.h> +libc_hidden_proto(brk) /* This must be initialized data because commons can't have aliases. */ +extern void *__curbrk; +libc_hidden_proto(__curbrk) void *__curbrk = 0; +libc_hidden_data_def(__curbrk) -int attribute_hidden __brk (void *addr) +int brk (void *addr) { void *__unbounded newbrk, *__unbounded scratch; - asm ("movl %%ebx, %1\n" /* Save %ebx in scratch register. */ + __asm__ ("movl %%ebx, %1\n" /* Save %ebx in scratch register. */ "movl %3, %%ebx\n" /* Put ADDR in %ebx to be syscall arg. */ "int $0x80 # %2\n" /* Perform the system call. */ "movl %1, %%ebx\n" /* Restore %ebx from scratch register. */ @@ -46,4 +50,4 @@ int attribute_hidden __brk (void *addr) return 0; } -strong_alias(__brk,brk) +libc_hidden_def(brk) |