[LTP] [PATCH v2 2/2] Refactor getegid02 using new LTP API

Petr Vorel pvorel@suse.cz
Tue Oct 17 13:35:09 CEST 2023


Hi all,

This code is based on Cyril's suggestion in v1 [1]
	if (GID_SIZE_CHECK(st_egid))
		TST_EXP_EQ_LI(gid, st_egid);
	else
		tst_res(TPASS, "getegid() passed");

I wonder which system returns 16 bit gid?

man getgid(2) says that originally there was only 16 bit, than kernel 2.4 added
support for 32 bit and the glibc getegid() wrapper transparently deal with this.

Because even I compile as 32 bit:

$ file getegid01_16
getegid01_16: ELF 32-bit LSB pie executable, Intel 80386

I get comparison, thus 32 bit:
$ ./getegid01_16
...
getegid01.c:25: TPASS: gid == st_egid (1000)

What am I missing?

Kind regards,
Petr

[1] https://lore.kernel.org/ltp/ZPCWWXXHG-oEB5qO@yuki/


More information about the ltp mailing list