File: Solaris.h

package info (click to toggle)
libproc-processtable-perl 0.637-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 672 kB
  • sloc: ansic: 5,765; perl: 568; makefile: 15
file content (93 lines) | stat: -rw-r--r-- 1,455 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <dirent.h>
#include <string.h>
#include <sys/resource.h>
#include <unistd.h>
#include <sys/proc.h> /* needed for process state constants */
#include <sys/statvfs.h>
#include <sys/types.h>

#if defined(PROC_FS)
#include <procfs.h>
#else
#include <sys/procfs.h>
#endif

#ifdef i386
#undef SP
#define SP sp
#endif

/****************************************/
/* Process state strings that we return */
/****************************************/
#define SLEEP  "sleep"
#define WAIT   "wait"       
#define RUN    "run"
#define IDLE   "idle"
#define ZOMBIE "defunct"
#define STOP   "stop"
#define ONPROC "onprocessor" 

extern void bless_into_proc(char* format, char** fields, ...);

/* Solaris is an all-or-nothing deal, all this stuff comes out of 
   one structure, so we don't need to dick around with the format much */
#if defined(PROC_FS)
static char Format[] = "iiiiiiiilllllliilllslssissi";
#else
static char Format[] = "iiiiiiiilllllllllslssssi";
#endif

/* Mapping of field to type */
static char* Fields[] = {

  "uid",
  "gid",
  "euid",
  "egid",
  "pid",
  "ppid",
  "pgrp",
  "sess",

  "priority",
  "nice",
  "ttynum",
  "flags",
  "time",
  "ctime",

#if defined(PROC_FS)
  "timensec",
  "ctimensec",
#endif

  "size",
  "rss",
  "wchan",

  "fname",

  "start",

  "pctcpu",
  "state",
#if defined(PROC_FS)
  "onpro",
#endif
  "pctmem",
  "cmndline",
  "numthr"
};