ubase/proc.h

43 lines
883 B
C
Raw Normal View History

2013-08-14 14:38:43 +00:00
/* See LICENSE file for copyright and license details. */
struct procstat {
int pid;
char comm[PATH_MAX + 2]; /* + 2 for '(' and ')' */
unsigned char state;
int ppid;
int pgrp;
int sid;
int tty_nr;
int tpgid;
unsigned flags;
unsigned long minflt;
unsigned long cminflt;
unsigned long majflt;
unsigned long cmajflt;
unsigned long utime;
unsigned long stime;
long cutime;
long cstime;
long priority;
long nice;
long num_threads;
long itrealvalue;
unsigned long long starttime;
unsigned long vsize;
long rss;
long rsslim;
};
2013-08-16 15:36:52 +00:00
struct procstatus {
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
};
int parsecmdline(pid_t pid, char *buf, size_t siz);
2013-08-14 14:38:43 +00:00
int parsestat(pid_t pid, struct procstat *ps);
2013-08-16 15:36:52 +00:00
int parsestatus(pid_t pid, struct procstatus *pstatus);
2013-08-14 14:38:43 +00:00
int proceuid(pid_t pid, uid_t *euid);
int procuid(pid_t pid, uid_t *euid);
2013-08-16 15:40:29 +00:00
int pidfile(const char *file);