setaliasent(3) Library Functions Manual setaliasent(3) setaliasent, endaliasent, getaliasent, getaliasent_r, getaliasbyname, getaliasbyname_r - LIBRARY Standard C library (libc, -lc) #include void setaliasent(void); void endaliasent(void); struct aliasent *getaliasent(void); int getaliasent_r(struct aliasent *restrict result, char buffer[restrict .buflen], size_t buflen, struct aliasent **restrict res); struct aliasent *getaliasbyname(const char *name); int getaliasbyname_r(const char *restrict name, struct aliasent *restrict result, char buffer[restrict .buflen], size_t buflen, struct aliasent **restrict res); , (NSS), (aliases), ( , getent --help.) . getaliasent() , . ; . setaliasent() . endaliasent() . getaliasent_r() . , . . getaliasbyname() . struct aliasent. getaliasbyname_r() . , . . struct aliasent : struct aliasent { char *alias_name; /* */ size_t alias_members_len; char **alias_members; /* */ int alias_local; }; getaliasent_r() getaliasbyname_r() . /etc/aliases. /etc/nsswitch.conf. attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |setaliasent(), | | MT-Safe locale | |endaliasent(), | | | |getaliasent_r(), | | | |getaliasbyname_r() | | | +----------------------------+----------------------------------------------------------+--------------------------+ |getaliasent(), | | MT-Unsafe | |getaliasbyname() | | | +----------------------------+----------------------------------------------------------+--------------------------+ GNU. The NeXT system has similar routines: #include void alias_setent(void); void alias_endent(void); alias_ent *alias_getent(void); alias_ent *alias_getbyname(char *name); gcc example.c -o example. . #include #include #include #include int main(void) { struct aliasent *al; setaliasent(); for (;;) { al = getaliasent(); if (al == NULL) break; printf("Name: %s\n", al->alias_name); } if (errno) { perror("reading alias"); exit(EXIT_FAILURE); } endaliasent(); exit(EXIT_SUCCESS); } . getgrent(3), getpwent(3), getspent(3), aliases(5) Alexander Golubev , Azamat Hackimov , Hotellook, Nikita , Spiros Georgaras , Vladislav , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . setaliasent(3)