/*
- * 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
*/
#include "tests.h"
-#include <stdio.h>
-#include <inttypes.h>
-#include <unistd.h>
#include <sys/syscall.h>
#if defined __NR_sched_getattr && defined __NR_sched_setattr
+# include <inttypes.h>
+# include <stdio.h>
+# include <unistd.h>
+
int
main(void)
{
} sched;
if (syscall(__NR_sched_getattr, 0, &sched, sizeof(sched), 0))
- return 77;
+ perror_msg_and_skip("sched_getattr");
printf("sched_getattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+, sched_flags=%s, sched_nice=%u, sched_priority=%u, sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 "\\}, 256, 0\\) += 0\n",
sched.attr.size,
sched.attr.sched_flags |= 1;
if (syscall(__NR_sched_setattr, 0, &sched, 0))
- return 77;
+ perror_msg_and_skip("sched_setattr");
printf("sched_setattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+, sched_flags=%s, sched_nice=%u, sched_priority=%u, sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 "\\}, 0\\) += 0\n",
sched.attr.size,
#else
-int
-main(void)
-{
- return 77;
-}
+SKIP_MAIN_UNDEFINED("__NR_sched_getattr && __NR_sched_setattr")
#endif