1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. 4 * William Roske, Dave Fenner 5 * Copyright (C) 2023 SUSE LLC Andrea Cervesato <[email protected]> 6 */ 7 8 /*\ 9 * [Description] 10 * 11 * This test checks if getegid() returns the effective group id. 12 */ 13 14 #include "tst_test.h" 15 #include "compat_tst_16.h" 16 run(void)17static void run(void) 18 { 19 gid_t gid, st_egid; 20 21 SAFE_FILE_LINES_SCANF("/proc/self/status", "Gid: %*d %d", &st_egid); 22 gid = getegid(); 23 24 if (GID_SIZE_CHECK(st_egid)) 25 TST_EXP_EQ_LI(gid, st_egid); 26 else 27 tst_res(TPASS, "getegid() passed"); 28 } 29 30 static struct tst_test test = { 31 .test_all = run, 32 }; 33