From: Dmitry V. Levin Date: Sun, 7 Feb 2016 23:46:33 +0000 (+0000) Subject: tests: extend coverage of time syscall X-Git-Tag: v4.12~577 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c736b456ad34ef37039f19dee48bc98af5a86d2f;p=strace tests: extend coverage of time syscall * tests/time.c (main): Check decoding of NULL time_t pointer. --- diff --git a/tests/time.c b/tests/time.c index f9fde5cb..041b0117 100644 --- a/tests/time.c +++ b/tests/time.c @@ -1,4 +1,6 @@ /* + * This file is part of time strace test. + * * Copyright (c) 2015-2016 Dmitry V. Levin * All rights reserved. * @@ -39,11 +41,13 @@ int main(void) { time_t *p = tail_alloc(sizeof(time_t)); - time_t t = syscall(__NR_time, p); + time_t t = syscall(__NR_time, NULL); if ((time_t) -1 == t) perror_msg_and_skip("time"); + printf("time(NULL) = %jd\n", (intmax_t) t); + t = syscall(__NR_time, p); printf("time([%jd]) = %jd\n", (intmax_t) *p, (intmax_t) t); puts("+++ exited with 0 +++");