tests/timerfd_xettime.c: use libtests
* tests/timerfd_xettime.c: Use SKIP_MAIN_UNDEFINED. (main): Use perror_msg_and_skip.
This commit is contained in:
parent
0566d548f9
commit
3a7c659e76
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -26,11 +26,7 @@
|
||||
*/
|
||||
|
||||
#include "tests.h"
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#if defined __NR_timerfd_create \
|
||||
@ -38,12 +34,17 @@
|
||||
&& defined __NR_timerfd_settime \
|
||||
&& defined O_CLOEXEC
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdint.h>
|
||||
# include <time.h>
|
||||
# include <unistd.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
(void) close(0);
|
||||
if (syscall(__NR_timerfd_create, CLOCK_MONOTONIC, O_CLOEXEC | O_NONBLOCK))
|
||||
return 77;
|
||||
perror_msg_and_skip("timerfd_create");
|
||||
puts("timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC|TFD_NONBLOCK) = 0");
|
||||
|
||||
struct {
|
||||
@ -60,7 +61,7 @@ main(void)
|
||||
};
|
||||
|
||||
if (syscall(__NR_timerfd_settime, 0, 0, &new.its, &old.its))
|
||||
return 77;
|
||||
perror_msg_and_skip("timerfd_settime");
|
||||
printf("timerfd_settime(0, 0"
|
||||
", {it_interval={%jd, %jd}, it_value={%jd, %jd}}"
|
||||
", {it_interval={%jd, %jd}, it_value={%jd, %jd}}"
|
||||
@ -75,7 +76,7 @@ main(void)
|
||||
(intmax_t) old.its.it_value.tv_nsec);
|
||||
|
||||
if (syscall(__NR_timerfd_gettime, 0, &old.its))
|
||||
return 77;
|
||||
perror_msg_and_skip("timerfd_gettime");
|
||||
printf("timerfd_gettime(0"
|
||||
", {it_interval={%jd, %jd}, it_value={%jd, %jd}}"
|
||||
") = 0\n",
|
||||
@ -90,10 +91,7 @@ main(void)
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
return 77;
|
||||
}
|
||||
SKIP_MAIN_UNDEFINED("__NR_timerfd_create && __NR_timerfd_gettime"
|
||||
" && __NR_timerfd_settime && O_CLOEXEC")
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user