Back to index

glibc  2.9
Functions | Variables
brk.c File Reference
#include <errno.h>
#include <unistd.h>
#include <sysdep.h>

Go to the source code of this file.

Functions

 weak_alias (__curbrk, ___brk_addr)

Variables

void * __curbrk = 0

Function Documentation

weak_alias ( __curbrk  ,
___brk_addr   
)

Definition at line 29 of file brk.c.

{
  void *newbrk;

  {
    register long int res __asm__ ("$2");

    asm ("move\t$4,%2\n\t"
        "li\t%0,%1\n\t"
        "syscall"           /* Perform the system call.  */
        : "=r" (res)
        : "I" (SYS_ify (brk)), "r" (addr)
        : "$4", "$7", __SYSCALL_CLOBBERS);
    newbrk = (void *) res;
  }
  __curbrk = newbrk;

  if (newbrk < addr)
    {
      __set_errno (ENOMEM);
      return -1;
    }

  return 0;
}

Here is the call graph for this function:


Variable Documentation

void* __curbrk = 0

Definition at line 24 of file brk.c.