There are no library calls to create a group. This is because there really is no such thing as creating a group. A GID is simply a number assigned to a process or file. All these numbers already exist - you have nothing to do to start using the GID. With the appropriate privileges, you can call chown (2) to set the GID of the file to any number or setgid (2) to set the GID of the current process (there is a bit more than that, with effective identifiers, additional identifiers, etc.).
The GID name is provided by writing to / etc / group on the underlying Unix / Linux / POSIX systems, but this is really just the convention used in custom Unix / Linux / POSIX tools. Other network directories also exist, as Jack Lloyd mentioned.
The man page group (5) describes the format of the / etc / group file, but it is not recommended to write it directly. Your distribution will list policies for distributing unnamed GIDs, for example, reserving certain spaces for different purposes (fixed system groups, dynamic system groups, user groups, etc.). The range of these number spaces differs from different distributions. These policies are typically encoded in command line tools that sysadmin uses to assign unnamed GIDs.
This means that the best way to add a group locally is to use command line tools.
camh
source share