busybox/libbb/missing_syscalls.c
Alistair Francis d3539be8f2 Remove stime() function calls
stime() has been deprecated in glibc 2.31 and replaced with
clock_settime(). Let's replace the stime() function calls with
clock_settime() in preperation.

function                                             old     new   delta
rdate_main                                           197     224     +27
clock_settime                                          -      27     +27
date_main                                            926     941     +15
stime                                                 37       -     -37
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 2/0 up/down: 69/-37)             Total: 32 bytes

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-11-19 13:08:25 +01:00

41 lines
777 B
C

/*
* Copyright 2012, Denys Vlasenko
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
//kbuild:lib-y += missing_syscalls.o
#include "libbb.h"
#if defined(ANDROID) || defined(__ANDROID__)
/*# include <linux/timex.h> - for struct timex, but may collide with <time.h> */
# include <sys/syscall.h>
pid_t getsid(pid_t pid)
{
return syscall(__NR_getsid, pid);
}
int sethostname(const char *name, size_t len)
{
return syscall(__NR_sethostname, name, len);
}
struct timex;
int adjtimex(struct timex *buf)
{
return syscall(__NR_adjtimex, buf);
}
int pivot_root(const char *new_root, const char *put_old)
{
return syscall(__NR_pivot_root, new_root, put_old);
}
# if __ANDROID_API__ < 21
int tcdrain(int fd)
{
return ioctl(fd, TCSBRK, 1);
}
# endif
#endif