[LTP] [PATCH v3] syscall01: use 32bit syscalls if available

Cyril Hrubis chrubis@suse.cz
Thu Feb 23 10:09:32 CET 2023


Hi!
> For 32-bit applications, the getuid/getgid syscalls return 16-bit ids,
> and the getuid32 and getgid32 syscalls return 32-bit ids.  When
> CONFIG_UID16 is disabled in the kernel, getuid/getgid (16-bit UIDs) are
> no longer available.  Thus this test will fail when compiled as 32-bit
> and with CONFIG_UID16 disabled.  For 64-bit applications, this is not an
> issue because getuid/getgid return 32-bit ids and getuid32/getgid32 are
> not defined.
> 
> The fix for this is to use getuid32/getgid32 if they are available to
> match the behavior of glibc.

Sounds reasonable, since we are attempting to test syscall() and not the
getuid implementation. Also this probably fixes the case where the test
would be executed with UID that does not fit into 16 bits as well.

Pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list