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

Andrea Cervesato via ltp <[email protected]> Thu, 23 Jul 2026 12:43:24 +0000
Newsgroups it.linux.lists.ltp
Message-ID <[email protected]>
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
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp