blob: bb866305844413e7ccc790480e73c6820dc7de13 [file] [log] [blame]
Rich Felkerc221d3e2018-09-06 11:15:15 -04001#define _BSD_SOURCE
2#include <unistd.h>
Rich Felkerfd142e52011-09-26 00:59:28 -04003#include <stdint.h>
Rich Felker7a995fe2014-01-02 17:03:34 -05004#include <errno.h>
Rich Felker0b44a032011-02-12 00:22:29 -05005#include "syscall.h"
6
Rich Felkerfd142e52011-09-26 00:59:28 -04007void *sbrk(intptr_t inc)
Rich Felker0b44a032011-02-12 00:22:29 -05008{
Rich Felker7a995fe2014-01-02 17:03:34 -05009 if (inc) return (void *)__syscall_ret(-ENOMEM);
10 return (void *)__syscall(SYS_brk, 0);
Rich Felker0b44a032011-02-12 00:22:29 -050011}