8 Process Control

·#include
pid_t getpid(void);
Returns: process ID of calling process
pid_t 四字节,见如下

#sys/_types.h
typedef __int32_t   __pid_t;    /* process [group] */

#sys/types.h
typedef __pid_t     pid_t;      /* user id */

pid_t getppid(void);
Returns: parent process ID of calling process
uid_t getuid(void);

sys/_types.h

typedef __uint32_t  __uid_t;
#sys/types.h
typedef __uid_t     uid_t;      /* user id */

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

你可能感兴趣的:(8 Process Control)