1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * Copyright (c) International Business Machines Corp., 2001 4 * 03/2001 - Written by Wayne Boyer 5 */ 6 7 /*\ 8 * [Description] 9 * 10 * Check that a getitimer() call fails with EFAULT with invalid itimerval pointer. 11 */ 12 13 #include <errno.h> 14 #include <sys/time.h> 15 #include "tst_test.h" 16 #include "lapi/syscalls.h" 17 sys_getitimer(int which,void * curr_value)18static int sys_getitimer(int which, void *curr_value) 19 { 20 return tst_syscall(__NR_getitimer, which, curr_value); 21 } 22 verify_getitimer(void)23static void verify_getitimer(void) 24 { 25 TST_EXP_FAIL(sys_getitimer(ITIMER_REAL, (struct itimerval *)-1), EFAULT); 26 } 27 28 static struct tst_test test = { 29 .test_all = verify_getitimer, 30 }; 31