* lib/pwio.c, lib/pwio.h: New function to find an user by
its UID on the local database.
+ * lib/groupio.c, lib/groupio.h: New function to find a group by
+ its GID on the local database.
2008-02-02 Nicolas François <nicolas.francois@centraliens.net>
return commonio_locate (&group_db, name);
}
+const struct group *gr_locate_gid (gid_t gid)
+{
+ const struct group *grp;
+
+ gr_rewind ();
+ while ( ((grp = gr_next ()) != NULL)
+ && (grp->gr_gid != gid)) {
+ }
+
+ return grp;
+}
+
int gr_update (const struct group *gr)
{
return commonio_update (&group_db, (const void *) gr);
+#include <grp.h>
extern int gr_close (void);
extern const struct group *gr_locate (const char *);
+extern const struct group *gr_locate_gid (gid_t gid);
extern int gr_lock (void);
extern int gr_name (const char *);
extern const struct group *gr_next (void);