开发者

adjtime() missing from Android bionic libc

开发者 https://www.devze.com 2023-02-16 08:23 出处:网络
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() wit

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消