This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: __curbrk (and &_end)


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]