获取进程标识符
#include <unistd.h>
pid_t getpid(void);
//Returns: process ID of calling process
pid_t getppid(void);
//Returns: parent process ID of calling process
uid_t getuid(void);
//Returns: real user ID of calling process
uid_t geteuid(void);
//Returns: effective user ID of calling process
gid_t getgid(void);
//Returns: real group ID of calling process
gid_t getegid(void);
//Returns: effective group ID of calling process
本文介绍了如何使用 C 语言中的 getpid, getppid, getuid, geteuid, getgid 和 getegid 函数来获取当前进程及其父进程的标识符,还包括了获取当前进程的真实和有效用户及组标识符的方法。
5234

被折叠的 条评论
为什么被折叠?



