[LTP] [PATCH v12 2/3] lib: New library function tst_get_free_uid

Andrea Cervesato andrea.cervesato@suse.com
Thu Jul 23 14:43:24 CEST 2026


Hi Wei,

> +/**
> + * tst_get_free_gid() - Find a GID not assigned to any group.
> + * @skip: GID value to skip (pass 0 to skip none).
> + *
> + * Scans the group database for the first unused GID starting from 1,
> + * skipping @skip. The @skip argument can be used to ignore e.g. the main
> + * group of a specific user in case it's not listed in the group file.
> + * Calls tst_brk(TBROK) if no free GID is found or a lookup error occurs.
> + *
> + * Return: An unused gid_t value.
> + */

This documentation is out of scope and should be sent from an another
patch-set.

> +		errno = 0;
> +		if (getpwuid(ret))
> +			continue;
> +
> +		if (errno == 0 || errno == ENOENT || errno == ESRCH) {

This contradicts the patch 1/3.

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com


More information about the ltp mailing list