当前位置: 代码迷 >> AIX >> aix下怎么获取进程号啊
  详细解决方案

aix下怎么获取进程号啊

热度:8364   发布时间:2013-02-26 00:00:00.0
aix下如何获取进程号啊?
我本来用的是gettid()函数,但却得到了错误:
ld: 0711-317 ERROR: Undefined symbol: .gettid
上网查了下,说是这个函数是linux特有的函数。我觉得,可能aix下没有吧。



------解决方案--------------------------------------------------------
难道不是getpid吗?
C/C++ code
NAME       getpid, getppid - get process identificationSYNOPSIS       #include <sys/types.h>       #include <unistd.h>       pid_t getpid(void);       pid_t getppid(void);DESCRIPTION       getpid() returns the process ID of the calling process.  (This is often used by routines that generate unique       temporary filenames.)       getppid() returns the process ID of the parent of the calling process.
  相关解决方案