summaryrefslogtreecommitdiff
path: root/src/libexec/peereid.c
blob: e2e5c5f00d9d85d78ffa565db89bd027fa6d1801 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>

int main(int argc,char *argv[]) {
 uid_t euid;
 gid_t egid;
 if(getpeereid(argc>1?atoi(argv[1]):0,&euid,&egid) == -1) return 1;
 printf("%d\n%d\n",euid,egid);
 return 0;
}