当前位置: 技术问答>linux和unix
如何在程序里面得到当前程序的进程 ID 号?
来源: 互联网 发布时间:2015-07-29
本文导语: RT | pid_t 不是结构, 是 unisigned int类型的数据。 getpid()就可以。 | NAME getpid, getppid - get process identification SYNOPSIS #include #include ...
RT
|
pid_t 不是结构,
是 unisigned int类型的数据。
getpid()就可以。
是 unisigned int类型的数据。
getpid()就可以。
|
NAME
getpid, getppid - get process identification
SYNOPSIS
#include
#include
pid_t getpid(void);
pid_t getppid(void);
DESCRIPTION
getpid returns the process ID of the current process. (This is often used by routines that generate
unique temporary file names.)
getppid returns the process ID of the parent of the current process.
CONFORMING TO
POSIX, BSD 4.3, SVID
SEE ALSO
exec(3), fork(2), kill(2), mkstemp(3), tmpnam(3), tempnam(3), tmpfile(3)
getpid, getppid - get process identification
SYNOPSIS
#include
#include
pid_t getpid(void);
pid_t getppid(void);
DESCRIPTION
getpid returns the process ID of the current process. (This is often used by routines that generate
unique temporary file names.)
getppid returns the process ID of the parent of the current process.
CONFORMING TO
POSIX, BSD 4.3, SVID
SEE ALSO
exec(3), fork(2), kill(2), mkstemp(3), tmpnam(3), tempnam(3), tmpfile(3)
|
getpid,得到进程的id,getppid,得到父进程的id
|
?
pid_t 根据系统可以不同。
pid_t 根据系统可以不同。
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。