2
* dstore.c - Solaris global storage for lsof
7
* Copyright 1994 Purdue Research Foundation, West Lafayette, Indiana
8
* 47907. All rights reserved.
10
* Written by Victor A. Abell
12
* This software is not subject to any license of the American Telephone
13
* and Telegraph Company or the Regents of the University of California.
15
* Permission is granted to anyone to use this software for any purpose on
16
* any computer system, and to alter it and redistribute it freely, subject
17
* to the following restrictions:
19
* 1. Neither the authors nor Purdue University are responsible for any
20
* consequences of the use of this software.
22
* 2. The origin of this software must not be misrepresented, either by
23
* explicit claim or by omission. Credit to the authors and Purdue
24
* University must appear in documentation and sources.
26
* 3. Altered versions must be plainly marked as such, and must not be
27
* misrepresented as being the original software.
29
* 4. This notice may not be removed or altered.
33
static char copyright[] =
34
"@(#) Copyright 1994 Purdue Research Foundation.\nAll rights reserved.\n";
35
static char *rcsid = "$Id: dstore.c,v 1.20 2006/03/27 22:57:33 abe Exp $";
43
* Global storage definitions
49
char *AFSApath = (char *)NULL; /* alternate AFS name list path
51
# endif /* defined(HASAOPT) */
53
dev_t AFSdev; /* AFS file system device number */
54
int AFSdevStat = 0; /* AFSdev status: 0 = unknown;
56
int AFSfstype = -1; /* AFS file system type index */
57
KA_T AFSVfsp = (KA_T)NULL; /* AFS vfs struct kernel address */
58
#endif /* defined(HAS_AFS) */
60
struct clone *Clone = NULL; /* clone list */
61
major_t CloneMaj; /* clone major device number */
65
* Drive_Nl -- table to drive the building of Nl[] via build_Nl()
66
* (See lsof.h and misc.c.)
69
struct drive_Nl Drive_Nl[] = {
70
{ "arFid", "afs_rootFid" },
71
{ "avops", "afs_vnodeops" },
72
{ "Avops", "Afs_vnodeops" },
73
{ "avol", "afs_volumes" },
74
{ "auvops", "auto_vnodeops" },
75
{ "ctfsadir", "ctfs_ops_adir" },
76
{ "ctfsbund", "ctfs_ops_bundle" },
77
{ "ctfscdir", "ctfs_ops_cdir" },
78
{ "ctfsctl", "ctfs_ops_ctl", },
79
{ "ctfsevt", "ctfs_ops_event", },
80
{ "ctfslate", "ctfs_ops_latest", },
81
{ "ctfsroot", "ctfs_ops_root", },
82
{ "ctfsstat", "ctfs_ops_stat", },
83
{ "ctfssym", "ctfs_ops_sym", },
84
{ "ctfstdir", "ctfs_ops_tdir", },
85
{ "ctfstmpl", "ctfs_ops_tmpl", },
86
{ "cvops", "cachefs_vnodeops" },
87
{ "clmaj", "clonemaj" },
88
{ "fdops", "fdvnodeops" },
89
{ "fvops", "fifo_vnodeops" },
90
{ "hvops", "hsfs_vnodeops" },
91
{ "lvops", "lo_vnodeops" },
92
{ "mntops", "mntvnodeops" },
93
{ "mvops", "mvfs_vnodeops" },
96
{ X_NCACHE, "ncache" },
97
{ X_NCSIZE, "ncsize" },
98
#else /* solaris>=90000 */
99
{ X_NCACHE, "nc_hash" },
100
{ X_NCSIZE, "nc_hashsz" },
101
{ "hshav", "nc_hashavelen" },
102
#endif /* solaris<90000 */
104
#if defined(NCACHE_NEGVN)
105
{ NCACHE_NEGVN, NCACHE_NEGVN },
106
#endif /* defined(NCACHE_NEGVN) */
108
{ "nvops", "nfs_vnodeops" },
109
{ "n3vops", "nfs3_vnodeops" },
110
{ "n4vops", "nfs4_vnodeops" },
111
{ "nmvops", "nm_vnodeops" },
112
{ "nproc", "nproc" },
113
{ "pdvops", "pcfs_dvnodeops" },
114
{ "pfvops", "pcfs_fvnodeops" },
115
{ "portvops", "port_vnodeops" },
116
{ "pract", "practive" },
117
{ "prvops", "prvnodeops" },
118
{ "sam1vops", "samfs_vnodeops" },
119
{ "sam2vops", "samfs_client_vnodeops" },
120
{ "sam3vops", "samfs_vnodeopsp" },
121
{ "sam4vops", "samfs_client_vnodeopsp" },
122
{ "sgvops", "segvn_ops" },
123
{ "sckvops", "sock_vnodeops" },
124
{ "spvops", "spec_vnodeops" },
125
{ "sncavops", "socknca_vnodeops" },
126
{ "stpivops", "socktpi_vnodeops" },
127
{ "tvops", "tmp_vnodeops" },
128
{ "uvops", "ufs_vnodeops" },
129
{ "vvfops", "fdd_vnops" },
130
{ "vvfcops", "fdd_chain_vnops" },
131
{ "vvfclops", "vx_fcl_vnodeops_p" },
132
{ "vvops", "vx_vnodeops" },
133
{ "vvops_p", "vx_vnodeops_p" },
136
{ "devops", "dv_vnodeops" },
137
{ "dvops", "door_vnodeops" },
138
{ "kbase", "_kernelbase" },
139
#endif /* solaris>=20500 */
143
#endif /* solaris>=20501 */
149
char **Fsinfo = NULL; /* file system information */
150
int Fsinfomax = 0; /* maximum file system type */
151
int HasALLKMEM = 0; /* has ALLKMEM device */
152
int HaveCloneMaj = 0; /* clone major device number has
153
* been identified and is in
155
kvm_t *Kd = NULL; /* kvm descriptor */
156
struct l_vfs *Lvfs = NULL; /* local vfs structure table */
157
struct netclone *Netclone = NULL; /* net clone devices from
160
#if defined(HASFSTRUCT)
162
* Pff_tab[] - table for printing file flags
165
struct pff_tab Pff_tab[] = {
166
{ (long)FREAD, FF_READ },
167
{ (long)FWRITE, FF_WRITE },
168
{ (long)FNDELAY, FF_NDELAY },
169
{ (long)FAPPEND, FF_APPEND },
170
{ (long)FSYNC, FF_SYNC },
172
# if defined(FREVOKED)
173
{ (long)FREVOKED, FF_REVOKED },
174
# endif /* defined(FREVOKED) */
176
{ (long)FDSYNC, FF_DSYNC },
177
{ (long)FRSYNC, FF_RSYNC },
179
# if defined(FOFFMAX)
180
{ (long)FOFFMAX, FF_LARGEFILE },
181
# endif /* defined(FFOFFMAX) */
183
{ (long)FNONBLOCK, FF_NBLOCK },
184
{ (long)FNOCTTY, FF_NOCTTY },
185
{ (long)FASYNC, FF_ASYNC },
186
{ (long)FNODSYNC, FF_NODSYNC },
192
* Pof_tab[] - table for print process open file flags
195
struct pff_tab Pof_tab[] = {
197
# if defined(UF_EXCLOSE)
198
{ (long)UF_EXCLOSE, POF_CLOEXEC },
199
# endif /* defined(UF_EXCLOSE) */
201
# if defined(FD_CLOEXEC)
202
{ (long)FD_CLOEXEC, POF_CLOEXEC },
203
# endif /* defined(FD_CLOEXEC) */
205
# if defined(UF_FDLOCK)
206
{ (long)UF_FDLOCK, POF_FDLOCK },
207
# endif /* defined(UF_FDLOCK) */
211
#endif /* defined(HASFSTRUCT) */
213
struct pseudo *Pseudo = NULL; /* non-clone devices from
215
int Unof; /* u_nofiles value */