美文网首页
8 Process Control

8 Process Control

作者: 半步江南 | 来源:发表于2018-12-13 14:44 被阅读0次

·#include <unistd.h>
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

      本文链接:https://www.haomeiwen.com/subject/tcuphqtx.html