~peter-pearse/ubuntu/natty/lsof/prop001

« back to all changes in this revision

Viewing changes to dialects/sun/dstore.c

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2006-05-15 18:08:45 UTC
  • mfrom: (1.2.2 upstream) (2.1.4 dapper)
  • Revision ID: james.westby@ubuntu.com-20060515180845-ag9wagz7dsf377d9
* Readded scripts which got lost with the upload of 4.77.dfsg.1-1.
* Documented the usage of example scripts. (closes: #184491)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * dstore.c - Solaris global storage for lsof
 
3
 */
 
4
 
 
5
 
 
6
/*
 
7
 * Copyright 1994 Purdue Research Foundation, West Lafayette, Indiana
 
8
 * 47907.  All rights reserved.
 
9
 *
 
10
 * Written by Victor A. Abell
 
11
 *
 
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.
 
14
 *
 
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:
 
18
 *
 
19
 * 1. Neither the authors nor Purdue University are responsible for any
 
20
 *    consequences of the use of this software.
 
21
 *
 
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.
 
25
 *
 
26
 * 3. Altered versions must be plainly marked as such, and must not be
 
27
 *    misrepresented as being the original software.
 
28
 *
 
29
 * 4. This notice may not be removed or altered.
 
30
 */
 
31
 
 
32
#ifndef lint
 
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 $";
 
36
#endif
 
37
 
 
38
 
 
39
#include "lsof.h"
 
40
 
 
41
 
 
42
/*
 
43
 * Global storage definitions
 
44
 */
 
45
 
 
46
#if     defined(HAS_AFS)
 
47
 
 
48
# if    defined(HASAOPT)
 
49
char *AFSApath = (char *)NULL;          /* alternate AFS name list path
 
50
                                         * (from -a) */
 
51
# endif /* defined(HASAOPT) */
 
52
 
 
53
dev_t AFSdev;                           /* AFS file system device number */
 
54
int AFSdevStat = 0;                     /* AFSdev status: 0 = unknown;
 
55
                                         *                1 = known */
 
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) */
 
59
 
 
60
struct clone *Clone = NULL;             /* clone list */
 
61
major_t CloneMaj;                       /* clone major device number */
 
62
 
 
63
 
 
64
/*
 
65
 * Drive_Nl -- table to drive the building of Nl[] via build_Nl()
 
66
 *             (See lsof.h and misc.c.)
 
67
 */
 
68
 
 
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"          },
 
94
 
 
95
#if     solaris<90000
 
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 */
 
103
 
 
104
#if     defined(NCACHE_NEGVN)
 
105
        { NCACHE_NEGVN, NCACHE_NEGVN             },
 
106
#endif  /* defined(NCACHE_NEGVN) */
 
107
 
 
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"          },
 
134
 
 
135
#if     solaris>=20500
 
136
        { "devops",     "dv_vnodeops"            },
 
137
        { "dvops",      "door_vnodeops"          },
 
138
        { "kbase",      "_kernelbase"            },
 
139
#endif  /* solaris>=20500 */
 
140
 
 
141
#if     solaris>=20501
 
142
        { "kasp",       "kas"                    },
 
143
#endif  /* solaris>=20501 */
 
144
 
 
145
        { "",           ""                       },
 
146
        { NULL,         NULL                     }
 
147
};
 
148
 
 
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
 
154
                                         * CloneMaj */
 
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
 
158
                                         * /devices/pseudo */
 
159
 
 
160
#if     defined(HASFSTRUCT)
 
161
/*
 
162
 * Pff_tab[] - table for printing file flags
 
163
 */
 
164
 
 
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         },
 
171
 
 
172
# if    defined(FREVOKED)
 
173
        { (long)FREVOKED,       FF_REVOKED      },
 
174
# endif /* defined(FREVOKED) */
 
175
 
 
176
        { (long)FDSYNC,         FF_DSYNC        },
 
177
        { (long)FRSYNC,         FF_RSYNC        },
 
178
 
 
179
# if    defined(FOFFMAX)
 
180
        { (long)FOFFMAX,        FF_LARGEFILE    },
 
181
# endif /* defined(FFOFFMAX) */
 
182
 
 
183
        { (long)FNONBLOCK,      FF_NBLOCK       },
 
184
        { (long)FNOCTTY,        FF_NOCTTY       },
 
185
        { (long)FASYNC,         FF_ASYNC        },
 
186
        { (long)FNODSYNC,       FF_NODSYNC      },
 
187
        { (long)0,              NULL            }
 
188
};
 
189
 
 
190
 
 
191
/*
 
192
 * Pof_tab[] - table for print process open file flags
 
193
 */
 
194
 
 
195
struct pff_tab Pof_tab[] = {
 
196
 
 
197
# if    defined(UF_EXCLOSE)
 
198
        { (long)UF_EXCLOSE,     POF_CLOEXEC     },
 
199
# endif /* defined(UF_EXCLOSE) */
 
200
 
 
201
# if    defined(FD_CLOEXEC)
 
202
        { (long)FD_CLOEXEC,     POF_CLOEXEC     },
 
203
# endif /* defined(FD_CLOEXEC) */
 
204
 
 
205
# if    defined(UF_FDLOCK)
 
206
        { (long)UF_FDLOCK,      POF_FDLOCK      },
 
207
# endif /* defined(UF_FDLOCK) */
 
208
 
 
209
        { (long)0,              NULL            }
 
210
};
 
211
#endif  /* defined(HASFSTRUCT) */
 
212
 
 
213
struct pseudo *Pseudo = NULL;           /* non-clone devices from
 
214
                                         * /devices/pseudo */
 
215
int Unof;                               /* u_nofiles value */