1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * 4 * Copyright (c) International Business Machines Corp., 2001 5 * 6 * Basic test for uname(): 7 * Calling uname() with invalid buf got EFAULT. 8 * 9 */ 10 11 #include <errno.h> 12 #include <sys/utsname.h> 13 #include "tst_test.h" 14 15 static void *bad_addr; 16 verify_uname(void)17static void verify_uname(void) 18 { 19 TST_EXP_FAIL(uname(bad_addr), EFAULT); 20 } 21 setup(void)22static void setup(void) 23 { 24 bad_addr = tst_get_bad_addr(NULL); 25 } 26 27 static struct tst_test test = { 28 .test_all = verify_uname, 29 .setup = setup, 30 }; 31