Created
July 3, 2015 01:48
-
-
Save chenfengyuan/7004198fd0e122fd9477 to your computer and use it in GitHub Desktop.
static link test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <pwd.h> | |
int main() | |
{ | |
struct passwd *p; | |
p = getpwnam("root"); | |
if (p == NULL) { | |
printf("no root!\n"); | |
} else { | |
printf("root is %d\n", p->pw_uid); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment