1
2
3
4
5
6
7
8#include "libbb.h"
9
10#if defined(ANDROID) || defined(__ANDROID__)
11
12# include <sys/syscall.h>
13pid_t getsid(pid_t pid)
14{
15 return syscall(__NR_getsid, pid);
16}
17
18int sethostname(const char *name, size_t len)
19{
20 return syscall(__NR_sethostname, name, len);
21}
22
23struct timex;
24int adjtimex(struct timex *buf)
25{
26 return syscall(__NR_adjtimex, buf);
27}
28
29int pivot_root(const char *new_root, const char *put_old)
30{
31 return syscall(__NR_pivot_root, new_root, put_old);
32}
33
34# if __ANDROID_API__ < 21
35int tcdrain(int fd)
36{
37 return ioctl(fd, TCSBRK, 1);
38}
39# endif
40#endif
41