[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Glibc-bsd-hackers] Re: __curbrk (and &_end)
From: |
Roland McGrath |
Subject: |
[Glibc-bsd-hackers] Re: __curbrk (and &_end) |
Date: |
Mon, 23 Feb 2004 13:23:09 -0800 |
> 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.