read process status

read process status

read:
/proc/pid/stat

See:
psmisc/prtstat.c

210 static void print_stat(const int pid, const opt_type options)
211 {
212 char *pathname;
213 char buf[BUFSIZ];
214 char *bptr;
215 FILE *fp;
216
217 struct proc_info *pr;
218 pr = malloc(sizeof(struct proc_info));
219
220 if ( (asprintf(&pathname, “/proc/%d/stat”,(int)pid)) < 0) {
221 perror(_("asprintf in print_stat failed.\n"));
222 exit(1);
223 }

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s