Add struct timex.tai support

* configure.ac (AC_CHECK_MEMBERS): Add struct timex.tai.
* print_timex.c (print_timex) [HAVE_STRUCT_TIMEX_TAI]: Print tai field.
* tests/adjtimex.c (main) [HAVE_STRUCT_TIMEX_TAI]: Likewise.
This commit is contained in:
Дмитрий Левин 2015-09-16 23:15:55 +00:00
parent dad1eef568
commit 0dbb7acc35
3 changed files with 13 additions and 1 deletions

View File

@ -332,6 +332,8 @@ AC_CHECK_MEMBERS([struct sigevent._sigev_un._pad,
AC_CHECK_TYPES([struct flock64],,, [#include <fcntl.h>])
AC_CHECK_MEMBERS([struct timex.tai],,, [#include <sys/timex.h>])
AC_CHECK_HEADERS([linux/input.h], [
AC_CHECK_MEMBERS([struct input_absinfo.resolution],,, [#include <linux/input.h>])
])

View File

@ -66,6 +66,9 @@ MPERS_PRINTER_DECL(int, print_timex)(struct tcb *tcp, const long addr)
tx.shift, (intmax_t) tx.stabil, (intmax_t) tx.jitcnt);
tprintf(", calcnt=%jd, errcnt=%jd, stbcnt=%jd",
(intmax_t) tx.calcnt, (intmax_t) tx.errcnt, (intmax_t) tx.stbcnt);
#ifdef HAVE_STRUCT_TIMEX_TAI
tprintf(", tai=%d", tx.tai);
#endif
tprints("}");
return 0;
}

View File

@ -46,7 +46,11 @@ main(void)
", esterror=%jd, status=%s, constant=%jd, precision=%jd"
", tolerance=%jd, time={%jd, %jd}, tick=%jd, ppsfreq=%jd"
", jitter=%jd, shift=%d, stabil=%jd, jitcnt=%jd, calcnt=%jd"
", errcnt=%jd, stbcnt=%jd\\}\\) = %d \\(TIME_[A-Z]+\\)\n",
", errcnt=%jd, stbcnt=%jd"
#ifdef HAVE_STRUCT_TIMEX_TAI
", tai=%d"
#endif
"\\}\\) = %d \\(TIME_[A-Z]+\\)\n",
(intmax_t) tx.offset,
(intmax_t) tx.freq,
(intmax_t) tx.maxerror,
@ -66,6 +70,9 @@ main(void)
(intmax_t) tx.calcnt,
(intmax_t) tx.errcnt,
(intmax_t) tx.stbcnt,
#ifdef HAVE_STRUCT_TIMEX_TAI
tx.tai,
#endif
state);
return 0;