- 论坛徽章:
- 0
|
#include
#include
#include
pid_t getpid(void);
pid_t getppid(void);
char *getcwd(char *buf, size_t size);
int main(void)
{
printf("process real UID: %d\n", getuid());
printf("process effect UID: %d\n", geteuid());
printf("process real GID: %d\n", getgid());
printf("process effect GID: %d\n", getegid());
printf("\n");
printf("process PID: %d\n", getpid());
printf("process PPID: %d\n", getppid());
printf("\n");
time_t now;
time(& now); /* get time */
printf("time is: %s\n", ctime(&now)); /* ctime() return char string */
printf("\n");
char buf[512];
printf("Current directory: %s\n", getcwd(buf, sizeof(buf)));
return(0);
}
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/20041/showart_124309.html |
|