aix下如何获取进程号啊?
我本来用的是gettid()函数,但却得到了错误:
ld: 0711-317 ERROR: Undefined symbol: .gettid
上网查了下,说是这个函数是linux特有的函数。我觉得,可能aix下没有吧。
[解决办法]
难道不是getpid吗?
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.