mirror of
https://github.com/systemd/systemd.git
synced 2024-11-06 16:59:03 +03:00
a41a0e28c2
Not hooked up to the build yet.
25 lines
491 B
C
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;
|
|
}
|