1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 16:59:03 +03:00
systemd/klibc/klibc/brk.c
greg@kroah.com a41a0e28c2 [PATCH] added klibc version 0.82 (cvs tree) to the udev tree.
Not hooked up to the build yet.
2005-04-26 21:05:23 -07:00

25 lines
491 B
C

/* brk.c - Change data segment size */
/* Written 2000 by Werner Almesberger */
#include <stddef.h>
#include <unistd.h>
#include <sys/types.h>
char *__current_brk; /* Common with sbrk.c */
/*
* The Linux brk() isn't what most people expect, so we call the
* system call __brk() and provide a wrapper.
*/
int brk(void *end_data_segment)
{
char *new_brk;
new_brk = __brk(end_data_segment);
if (new_brk != end_data_segment) return -1;
__current_brk = new_brk;
return 0;
}