adjtime() missing from Android bionic libc
I'm trying to compile an ntp client for android using the android build system and running into a problem where adjtime() appears to be missing in bionic libc. How can I add support for adjtime() without modifyin开发者_运维技巧g bionic?
I'm compiling openntpd for reference.
Perhaps you could invoke the syscall raw?
/* if it's not already defined, be sure to check this:
syscall numbering is different on every architecture */
#define SYS_adjtimex 124
int adjtimex(struct timex *txc) {
return syscall1(SYS_adjtimex, (void *)txc);
}
See the adjtimex
documentation if you need, as it's a Linux-specific syscall that works somewhat differently than the adjtime
.
精彩评论