Question about file layout for the passwd/group reimplementation (#5420)

Hi all,

I am working on issue #5420, “Reimplement POSIX passwd and group Entry APIs” (link: Reimplement POSIX passwd and group Entry APIs (#5420) · Issues · RTEMS / RTOS / RTEMS · GitLab).

I have been studying the current RTEMS files and comparing them with the FreeBSD implementation. At the moment, I have a working getgrent.c replacement and a getgrnam.c replacement that still keep the current RTEMS file split, and the psxpasswd01 test passes with these changes.

While reading the FreeBSD source, I noticed that the group-related non-_r interfaces such as getgrnam() and getgrgid() are implemented within getgrent.c, rather than being kept in separate source files.

Before I continue, I would like to ask about the preferred direction for RTEMS:

  1. Should I keep the current RTEMS file layout and continue with separate files such as getgrent.c and getgrnam.c, while only reusing/adapting FreeBSD logic internally?
  2. Or would it be preferable to also reorganize the RTEMS source layout to more closely follow the current FreeBSD structure, for example by merging the group-related non-_r wrappers into getgrent.c?

My current inclination is to keep the existing RTEMS file split unless there is a preference to change it, since that seems like the smaller structural change. If so, I would likely follow the same layout approach for the passwd-related files as well for consistency.

However, I wanted to confirm before moving further.

Thanks.

if the freebsd sources are used, it would be better to import them into contrib and use them with minimal modifications.

There are instructions in the README.md inside contrib/ on how to import source. It also includes how to import something that does not have a version number but a revision or date instead.

Thanks @gedare and @amar, that makes sense.I will review the contrib/README.md instructions and adjust my approach accordingly.