From: Dmitry V. Levin Date: Wed, 6 Jan 2016 09:49:32 +0000 (+0000) Subject: tests/timer_create.c: use libtests X-Git-Tag: v4.12~716 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=21bbc14575453e4fba60cef9fc16d5c809bb9a73;p=strace tests/timer_create.c: use libtests * tests/timer_create.c: Use SKIP_MAIN_UNDEFINED. (main): Use perror_msg_and_skip. --- diff --git a/tests/timer_create.c b/tests/timer_create.c index 983aa970..651b426e 100644 --- a/tests/timer_create.c +++ b/tests/timer_create.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2016 Dmitry V. Levin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,14 +26,15 @@ */ #include "tests.h" -#include -#include -#include -#include #include #ifdef __NR_timer_create +# include +# include +# include +# include + int main(void) { @@ -46,7 +47,7 @@ main(void) }; if (syscall(__NR_timer_create, CLOCK_REALTIME, &sev, &tid[0])) - return 77; + perror_msg_and_skip("timer_create CLOCK_REALTIME"); printf("timer_create(CLOCK_REALTIME, {sigev_value={int=%d, ptr=%p}" ", sigev_signo=%u, sigev_notify=SIGEV_NONE}" ", [%d]) = 0\n", @@ -57,7 +58,7 @@ main(void) sev.sigev_notify = SIGEV_SIGNAL; sev.sigev_signo = SIGALRM; if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid[1])) - return 77; + perror_msg_and_skip("timer_create CLOCK_MONOTONIC"); printf("timer_create(CLOCK_MONOTONIC, {sigev_value={int=%d, ptr=%p}" ", sigev_signo=SIGALRM, sigev_notify=SIGEV_SIGNAL}" ", [%d]) = 0\n", @@ -70,7 +71,7 @@ main(void) sev.sigev_notify_attributes = (void *) (unsigned long) 0xcafef00dfacefeed; if (syscall(__NR_timer_create, CLOCK_REALTIME, &sev, &tid[2])) - return 77; + perror_msg_and_skip("timer_create CLOCK_REALTIME"); printf("timer_create(CLOCK_REALTIME, {sigev_value={int=%d, ptr=%p}" ", sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD" ", sigev_notify_function=%p, sigev_notify_attributes=%p}" @@ -96,7 +97,7 @@ main(void) sev.sigev_notify = SIGEV_THREAD_ID; sev.sigev_notify_thread_id = getpid(); if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid[3])) - return 77; + perror_msg_and_skip("timer_create CLOCK_MONOTONIC"); printf("timer_create(CLOCK_MONOTONIC, {sigev_value={int=%d, ptr=%p}" ", sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD_ID" ", sigev_notify_thread_id=%d}" @@ -113,10 +114,6 @@ main(void) #else -int -main(void) -{ - return 77; -} +SKIP_MAIN_UNDEFINED("__NR_timer_create") #endif