Skip to content

Instantly share code, notes, and snippets.

@chenfengyuan
Created July 3, 2015 01:48
Show Gist options
  • Save chenfengyuan/7004198fd0e122fd9477 to your computer and use it in GitHub Desktop.
Save chenfengyuan/7004198fd0e122fd9477 to your computer and use it in GitHub Desktop.
static link test
#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