How does getpwnam () work in linux?

how does getpwnam () work in linux?

recently I was studying linux programming and encountered a function getpwnam (). This function definition is defined in pwd.h as:

extern struct passwd *getpwnam (const char *__name);

then I started to find out where the function was implemented. I downloaded a GNU lib, and didn"t find the getpwnam, but found a file called getpwnam.c

.
-sharpinclude <pwd.h>


-sharpdefine LOOKUP_TYPE    struct passwd
-sharpdefine FUNCTION_NAME    getpwnam
-sharpdefine DATABASE_NAME    passwd
-sharpdefine ADD_PARAMS    const char *name
-sharpdefine ADD_VARIABLES    name
-sharpdefine BUFLEN        NSS_BUFLEN_PASSWD

-sharpinclude "../nss/getXXbyYY.c"

but no other implementation getpwnam, was found. Excuse me, where is this getpwnam implemented?

C
May.06,2021

if you open the file .. / nss/getXXbyYY.c , you will suddenly realize

or you can use gcc-E to preprocess getpwnam.c to see

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3be0a-2c2ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3be0a-2c2ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?