]> granicus.if.org Git - strace/commit
tests: check decoding of SO_TIMESTAMP*_NEW control messages
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 17 May 2019 16:16:29 +0000 (16:16 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 17 May 2019 16:16:29 +0000 (16:16 +0000)
commit9a2457d7cedef53d2890c38a7cd12af3c2c22c78
tree7f74e9b2f1f37cfee6427ba5161206dd70062d82
parente26b1a755a66bf868a00003ca29498e1a3d150a0
tests: check decoding of SO_TIMESTAMP*_NEW control messages

* configure.ac (AC_CHECK_TYPES): Check for struct __kernel_timespec
and struct __kernel_sock_timeval.
* tests/msg_control.c [HAVE_STRUCT___KERNEL_SOCK_TIMEVAL ||
HAVE_STRUCT___KERNEL_TIMESPEC]: Include <linux/time_types.h>.
(test_scm_timestamp): Rename to test_scm_timestamp_old.
(test_scm_timestampns): Rename to test_scm_timestampns_old.
(test_scm_timestamping): Rename to test_scm_timestamping_old.
[HAVE_STRUCT___KERNEL_SOCK_TIMEVAL] (test_scm_timestamp_new): New
function.
[HAVE_STRUCT___KERNEL_TIMESPEC] (test_scm_timestampns_new,
test_scm_timestamping_new): New functions.
(test_sol_socket): Use them.
* tests/sockopt-timestamp.c [HAVE_STRUCT___KERNEL_SOCK_TIMEVAL ||
HAVE_STRUCT___KERNEL_TIMESPEC]: Include <linux/time_types.h>.
Include "xlat/sock_options.h" in XLAT_MACROS_ONLY mode.
(print_timestampns_old): Define unconditionally.
[HAVE_STRUCT___KERNEL_SOCK_TIMEVAL] (print_timestamp_new): New function.
[HAVE_STRUCT___KERNEL_TIMESPEC] (print_timestampns_new): Likewise.
(main): Test SO_TIMESTAMPNS_OLD unconditionally.
[HAVE_STRUCT___KERNEL_SOCK_TIMEVAL]: Test SO_TIMESTAMP_NEW.
[HAVE_STRUCT___KERNEL_TIMESPEC]: Test SO_TIMESTAMPNS_NEW.
configure.ac
tests/msg_control.c
tests/sockopt-timestamp.c