- 論壇徽章:
- 0
|
今天查了man手冊,也試驗(yàn)了下
#include <procinfo.h>
#include <sys/types.h>
int
getprocs ( ProcessBuffer, ProcessSize, FileBuffer, FileSize, IndexPointer, Count)
struct procsinfo *ProcessBuffer;
or struct procsinfo64 *ProcessBuffer;
int ProcessSize;
struct fdsinfo *FileBuffer;
int FileSize;
pid_t *IndexPointer;
int Count;
這個(gè)頭文件procinfo.h里很詳細(xì),pid、ppid、uid、command、path(是個(gè)文件描述符,而且好像是運(yùn)行時(shí)的路徑)
等都能獲取,但是就是找到它的stime和utime時(shí)發(fā)現(xiàn)有點(diǎn)不對勁:
utime竟然是一個(gè)9位數(shù)的無符號(hào)整數(shù)(user time)
stime是一個(gè)12位的無符號(hào)整數(shù)(system time)
不知怎么樣獲取它的啟動(dòng)時(shí)間,各位幫忙一下啊 |
|