chiark / gitweb /
[PATCH] support SUBSYSTEM as a rule key
[elogind.git] / klibc / klibc / brk.c
1 /* brk.c - Change data segment size */
2
3 /* Written 2000 by Werner Almesberger */
4
5
6 #include <stddef.h>
7 #include <unistd.h>
8 #include <sys/types.h>
9
10 char *__current_brk;            /* Common with sbrk.c */
11
12 /*
13  * The Linux brk() isn't what most people expect, so we call the
14  * system call __brk() and provide a wrapper.
15  */
16 int brk(void *end_data_segment)
17 {
18   char *new_brk;
19   
20   new_brk = __brk(end_data_segment);
21   if (new_brk != end_data_segment) return -1;
22   __current_brk = new_brk;
23   return 0;
24 }