45 lines
871 B
C
45 lines
871 B
C
#ifndef _PROC_PARSER
|
|
#define _PROC_PARSER
|
|
|
|
#include <pwd.h>
|
|
#include <grp.h>
|
|
#include <limits.h>
|
|
|
|
struct mu_proc {
|
|
/* from status */
|
|
uid_t uid;
|
|
gid_t gid;
|
|
long vmrss;
|
|
|
|
/* from stat */
|
|
pid_t pid;
|
|
char cmdline[PATH_MAX + 1];
|
|
char state;
|
|
int ppid;
|
|
int pgrp;
|
|
int sid;
|
|
int tty;
|
|
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;
|
|
};
|
|
|
|
int mu_proc_status(const char *prog_name, const pid_t pid, struct mu_proc *proc_s);
|
|
int mu_proc_stat(const char *prog_name, const pid_t pid, struct mu_proc *proc_s);
|
|
int mu_proc_parser(const char *prog_name, const pid_t pid, struct mu_proc *proc_s);
|
|
#endif
|