【问题标题】:adjtime() missing from Android bionic libcAndroid 仿生 libc 中缺少 adjtime()
【发布时间】:2011-03-09 21:31:36
【问题描述】:

我正在尝试使用 android 构建系统为 android 编译 ntp 客户端,但遇到了仿生 libc 中似乎缺少 adjtime() 的问题。如何在不修改仿生的情况下添加对 adjtime() 的支持?

我正在编译 openntpd 以供参考。

【问题讨论】:

    标签: android c linux android-ndk


    【解决方案1】:

    也许您可以调用原始系统调用?

    /* 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);
    }
    

    如果需要,请参阅 adjtimex 文档,因为它是一个特定于 Linux 的系统调用,其工作方式与 adjtime 略有不同。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-06
      • 1970-01-01
      • 2023-01-14
      • 2023-03-26
      • 2013-01-18
      • 2017-01-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多