libcfe  0.12.1
some useful C-functions
uname_gname.c File Reference
#include "config.h"
#include "uname_gname.h"
#include <string.h>
#include <stdlib.h>
#include <grp.h>
#include "len.h"
Include dependency graph for uname_gname.c:

Go to the source code of this file.

Functions

char * get_uname (uid_t uid)
 
char * get_gname (gid_t gid)
 

Function Documentation

◆ get_gname()

char* get_gname ( gid_t  gid)

Search for the corresponding group name with a given group id.

Parameters
[in]gidThe numeric group id.
Returns
Pointer to a newly allocated string, containing the group name (this should be freed with free()).

Definition at line 37 of file uname_gname.c.

◆ get_uname()

char* get_uname ( uid_t  uid)

Search for the corresponding user name with a given user id.

Parameters
[in]uidThe numeric user id.
Returns
Pointer to a newly allocated string, containing the user name (this should be freed with free()).

Definition at line 16 of file uname_gname.c.