Re: [LTP] [PATCH v12 2/3] lib: New library function tst_get_free_uid
Wei Gao via ltp <[email protected]> Thu, 23 Jul 2026 23:54:05 +0000
| Newsgroups | it.linux.lists.ltp |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Jul 23, 2026 at 12:43:24PM +0000, Andrea Cervesato wrote:
> 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.
This line is same as patch 1/3, could you give more detail where
contradicts?
>
> --
> Andrea Cervesato
> SUSE QE Automation Engineer Linux
> [email protected]
--
Mailing list info: https://lists.linux.it/listinfo/ltp