1*49cdfc7eSAndroid Build Coastguard Worker // SPDX-License-Identifier: GPL-2.0-or-later 2*49cdfc7eSAndroid Build Coastguard Worker /* 3*49cdfc7eSAndroid Build Coastguard Worker * Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved. 4*49cdfc7eSAndroid Build Coastguard Worker * AUTHOR: Saji Kumar.V.R <[email protected]> 5*49cdfc7eSAndroid Build Coastguard Worker */ 6*49cdfc7eSAndroid Build Coastguard Worker 7*49cdfc7eSAndroid Build Coastguard Worker /*\ 8*49cdfc7eSAndroid Build Coastguard Worker * [Description] 9*49cdfc7eSAndroid Build Coastguard Worker * 10*49cdfc7eSAndroid Build Coastguard Worker * Basic test for getdomainname(2) 11*49cdfc7eSAndroid Build Coastguard Worker * 12*49cdfc7eSAndroid Build Coastguard Worker * This is a Phase I test for the getdomainname(2) system call. 13*49cdfc7eSAndroid Build Coastguard Worker * It is intended to provide a limited exposure of the system call. 14*49cdfc7eSAndroid Build Coastguard Worker */ 15*49cdfc7eSAndroid Build Coastguard Worker 16*49cdfc7eSAndroid Build Coastguard Worker #include <linux/utsname.h> 17*49cdfc7eSAndroid Build Coastguard Worker #include "tst_test.h" 18*49cdfc7eSAndroid Build Coastguard Worker 19*49cdfc7eSAndroid Build Coastguard Worker #define MAX_NAME_LEN __NEW_UTS_LEN 20*49cdfc7eSAndroid Build Coastguard Worker verify_getdomainname(void)21*49cdfc7eSAndroid Build Coastguard Workerstatic void verify_getdomainname(void) 22*49cdfc7eSAndroid Build Coastguard Worker { 23*49cdfc7eSAndroid Build Coastguard Worker char domain_name[MAX_NAME_LEN]; 24*49cdfc7eSAndroid Build Coastguard Worker 25*49cdfc7eSAndroid Build Coastguard Worker TST_EXP_PASS(getdomainname(domain_name, sizeof(domain_name))); 26*49cdfc7eSAndroid Build Coastguard Worker } 27*49cdfc7eSAndroid Build Coastguard Worker 28*49cdfc7eSAndroid Build Coastguard Worker static struct tst_test test = { 29*49cdfc7eSAndroid Build Coastguard Worker .test_all = verify_getdomainname, 30*49cdfc7eSAndroid Build Coastguard Worker }; 31