1 /** Linux system call interface.
2 * Written by Shaun Jackman <sjackman@gmail.com>.
3 * Copyright 2006 Pathway Connectivity
5 * Permission to use, copy, modify, and distribute this software
6 * is freely granted, provided that this notice is preserved.
13 static void *curbrk
= _end
;
15 extern void *_brk(void *addr
);
31 void *_sbrk(intptr_t incr
)
33 void *oldbrk
= curbrk
;
34 if (brk(oldbrk
+ incr
) == -1)
39 void *sbrk(intptr_t incr
) __attribute__((alias("_sbrk")));
54 pid_t
wait4(pid_t pid
, int *status
, int options
, struct rusage
*rusage
);
56 pid_t
_wait(int *status
)
58 return wait4(-1, status
, 0, NULL
);
61 pid_t
waitpid(pid_t pid
, int *status
, int options
)
63 return wait4(pid
, status
, options
, NULL
);
66 extern int _reboot(int magic
, int magic2
, int flag
, void *arg
);
70 return _reboot(0xfee1dead, 0x28121969, flag
, NULL
);