__curbrk (and &_end)
Roland McGrath
roland@redhat.com
Mon Feb 23 21:23:00 GMT 2004
> The resulting code is pretty generic, and I think it could be added to
> sysdeps/generic/brk.c. Would you like me to send a patch for that? It'd
> roughly look like:
>
> int
> __brk (void *addr)
> {
> #ifdef SYS_break
> if (__curbrk == NULL)
> __curbrk = &_end;
> ...
> if (syscall (SYS_break, addr) == -1)
> ...
> #else
> __set_errno (ENOSYS)
> return -1;
> #endif
> }
No other implementation will look like this, unless you replace syscall
with something like the linux INLINE_SYSCALL_* macros.
More information about the Libc-alpha
mailing list