micro-utils/libmu/proc_parser.h

46 lines
898 B
C
Raw Normal View History

2024-07-09 19:33:45 +00:00
#ifndef _PROC_PARSER
#define _PROC_PARSER
#include <pwd.h>
#include <grp.h>
#include <limits.h>
struct mu_proc {
/* from status */
char prog[PATH_MAX + 1];
uid_t uid;
gid_t gid;
/* 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;
long rsslim;
};
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