Rich Felker | c221d3e | 2018-09-06 11:15:15 -0400 | [diff] [blame] | 1 | #define _BSD_SOURCE |
2 | #include <unistd.h> | ||||
Rich Felker | fd142e5 | 2011-09-26 00:59:28 -0400 | [diff] [blame] | 3 | #include <stdint.h> |
Rich Felker | 7a995fe | 2014-01-02 17:03:34 -0500 | [diff] [blame] | 4 | #include <errno.h> |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 5 | #include "syscall.h" |
6 | |||||
Rich Felker | fd142e5 | 2011-09-26 00:59:28 -0400 | [diff] [blame] | 7 | void *sbrk(intptr_t inc) |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 8 | { |
Rich Felker | 7a995fe | 2014-01-02 17:03:34 -0500 | [diff] [blame] | 9 | if (inc) return (void *)__syscall_ret(-ENOMEM); |
10 | return (void *)__syscall(SYS_brk, 0); | ||||
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 11 | } |