blob: dc40d91552f176cafd7d93eaafe9a8db6ee171c5 [file] [log] [blame]
Tias Gunsc9677ed2012-06-10 14:40:30 +02001/*
2 * Copyright 2012, Denys Vlasenko
3 *
4 * Licensed under GPLv2, see file LICENSE in this source tree.
5 */
Tias Gunsc9677ed2012-06-10 14:40:30 +02006//kbuild:lib-y += missing_syscalls.o
7
Tias Gunsc9677ed2012-06-10 14:40:30 +02008#include "libbb.h"
9
10#if defined(ANDROID) || defined(__ANDROID__)
Sean MacLennand9aabfe2018-03-04 23:15:59 +010011/*# include <linux/timex.h> - for struct timex, but may collide with <time.h> */
12# include <sys/syscall.h>
Tias Gunsc9677ed2012-06-10 14:40:30 +020013pid_t getsid(pid_t pid)
14{
15 return syscall(__NR_getsid, pid);
16}
17
Tias Gunsc9677ed2012-06-10 14:40:30 +020018int 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}
Matt Whitlock93b98ff2015-04-26 13:14:50 +020033
Chris Renshaw6df96122015-12-17 16:42:01 +010034# if __ANDROID_API__ < 21
Matt Whitlock93b98ff2015-04-26 13:14:50 +020035int tcdrain(int fd)
36{
37 return ioctl(fd, TCSBRK, 1);
38}
Chris Renshaw6df96122015-12-17 16:42:01 +010039# endif
Tias Gunsc9677ed2012-06-10 14:40:30 +020040#endif