File: NetBSD.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 (103 lines) | stat: -rw-r--r-- 1,460 bytes parent folder | download | duplicates (7)
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
94
95
96
97
98
99
100
101
102
103
#include <sys/types.h>
#include <sys/param.h>
#if defined(__NetBSD__) && __NetBSD_Version__ > 299000900
#include <sys/statvfs.h>
#define statfs statvfs
#else
#include <sys/mount.h>
#endif
#include <sys/stat.h>
#include <ctype.h>
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct procstat {
  char comm[MAXCOMLEN+1];
  int pid;
  int ppid;
  int pgid;
  int sid;
  int tdev_maj;
  int tdev_min;
  char flags[256]; /* XXX */
  int start;
  int start_mic;
  int utime;
  int utime_mic;
  int stime;
  int stime_mic;
  char wchan[256]; /* XXX */
  int euid;
  int ruid;
  int rgid;
  int egid;
  char groups[256]; /* XXX */
};

/* We need to pass in a cap for ignore, lower for store on object */
/* We can just lc these! */
static char Defaultformat[] = "iiiiiissssssiisssis";

/* Mapping of field to type */
static char* Fields[] = {
  "uid",
#define F_UID 0 

  "gid",
#define F_GID 1

  "pid",
#define F_PID 2

  "ppid",
#define F_PPID 3

  "pgrp",
#define F_PGRP 4

  "sess",
#define F_SESS 5

  "flags",
#define F_FLAGS 6

  "utime",
#define F_UTIME 7

  "stime",
#define F_STIME 8

  "time",
#define F_TIME 9

  "wchan",
#define F_WCHAN 10

  "start",
#define F_START 11

  "euid",
#define F_EUID 12

  "egid",
#define F_EGID 13

  "fname",
#define F_FNAME 14

  "state",
#define F_STATE 15

  "ttydev",
#define F_TTYDEV 16

  "ttynum",
#define F_TTYNUM 17

  "cmndline"
#define F_CMNDLINE 18

#define F_LASTFIELD 18
};