2 * lsof_field.h - field ID characters for lsof output that can be parsed
3 * (selected with -f or -F)
8 * Copyright 1994 Purdue Research Foundation, West Lafayette, Indiana
9 * 47907. All rights reserved.
11 * Written by Victor A. Abell
13 * This software is not subject to any license of the American Telephone
14 * and Telegraph Company or the Regents of the University of California.
16 * Permission is granted to anyone to use this software for any purpose on
17 * any computer system, and to alter it and redistribute it freely, subject
18 * to the following restrictions:
20 * 1. Neither the authors nor Purdue University are responsible for any
21 * consequences of the use of this software.
23 * 2. The origin of this software must not be misrepresented, either by
24 * explicit claim or by omission. Credit to the authors and Purdue
25 * University must appear in documentation and sources.
27 * 3. Altered versions must be plainly marked as such, and must not be
28 * misrepresented as being the original software.
30 * 4. This notice may not be removed or altered.
35 * $Id: lsof_fields.h,v 1.11 2006/09/15 18:53:21 abe Exp $
39 #if !defined(LSOF_FORMAT_H)
40 #define LSOF_FORMAT_H 1
43 * Codes for output fields:
45 * LSOF_FID_* ID character
49 * A field is displayed in the form:
50 * <ID_character><data><field_terminator>
52 * Output fields are normally terminated with a NL ('\n'), but the field
53 * terminator can be set to NUL with the -0 (zero) option to lsof.
55 * Field sets -- process-specific information or information specific
56 * to a single file descriptor -- are terminated with NL when the field
60 #define LSOF_FID_ACCESS 'a'
61 #define LSOF_FIX_ACCESS 0
62 #define LSOF_FNM_ACCESS "access: r = read; w = write; u = read/write"
64 #define LSOF_FID_CMD 'c'
65 #define LSOF_FIX_CMD 1
66 #define LSOF_FNM_CMD "command name"
68 #define LSOF_FID_CT 'C'
70 #define LSOF_FNM_CT "file struct share count"
72 #define LSOF_FID_DEVCH 'd'
73 #define LSOF_FIX_DEVCH 3
74 #define LSOF_FNM_DEVCH "device character code"
76 #define LSOF_FID_DEVN 'D'
77 #define LSOF_FIX_DEVN 4
78 #define LSOF_FNM_DEVN "major/minor device number as 0x<hex>"
80 #define LSOF_FID_FD 'f'
82 #define LSOF_FNM_FD "file descriptor"
84 #define LSOF_FID_FA 'F'
86 #define LSOF_FNM_FA "file struct address as 0x<hex>"
88 #define LSOF_FID_FG 'G'
90 #define LSOF_FNM_FG "file flaGs"
92 #define LSOF_FID_INODE 'i'
93 #define LSOF_FIX_INODE 8
94 #define LSOF_FNM_INODE "inode number"
96 #define LSOF_FID_NLINK 'k'
97 #define LSOF_FIX_NLINK 9
98 #define LSOF_FNM_NLINK "link count"
100 #define LSOF_FID_LOCK 'l'
101 #define LSOF_FIX_LOCK 10
102 #define LSOF_FNM_LOCK "lock: r/R = read; w/W = write; u = read/write"
104 #define LSOF_FID_LOGIN 'L'
105 #define LSOF_FIX_LOGIN 11
106 #define LSOF_FNM_LOGIN "login name"
108 #define LSOF_FID_MARK 'm'
109 #define LSOF_FIX_MARK 12
110 #define LSOF_FNM_MARK "marker between repeated output"
112 #define LSOF_FID_NAME 'n'
113 #define LSOF_FIX_NAME 13
114 #define LSOF_FNM_NAME "comment, name, Internet addresses"
116 #define LSOF_FID_NI 'N'
117 #define LSOF_FIX_NI 14
118 #define LSOF_FNM_NI "file struct node ID as 0x<hex>"
120 #define LSOF_FID_OFFSET 'o'
121 #define LSOF_FIX_OFFSET 15
122 #define LSOF_FNM_OFFSET "file offset as 0t<dec> or 0x<hex>"
124 #define LSOF_FID_PID 'p'
125 #define LSOF_FIX_PID 16
126 #define LSOF_FNM_PID "process ID (PID)"
128 #define LSOF_FID_PGID 'g'
129 #define LSOF_FIX_PGID 17
130 #define LSOF_FNM_PGID "process group ID (PGID)"
132 #define LSOF_FID_PROTO 'P'
133 #define LSOF_FIX_PROTO 18
134 #define LSOF_FNM_PROTO "protocol name"
136 #define LSOF_FID_RDEV 'r'
137 #define LSOF_FIX_RDEV 19
138 #define LSOF_FNM_RDEV "raw device number as 0x<hex>"
140 #define LSOF_FID_PPID 'R'
141 #define LSOF_FIX_PPID 20
142 #define LSOF_FNM_PPID "paRent PID"
144 #define LSOF_FID_SIZE 's'
145 #define LSOF_FIX_SIZE 21
146 #define LSOF_FNM_SIZE "file size"
148 #define LSOF_FID_STREAM 'S'
149 #define LSOF_FIX_STREAM 22
150 #define LSOF_FNM_STREAM "stream module and device names"
152 #define LSOF_FID_TYPE 't'
153 #define LSOF_FIX_TYPE 23
154 #define LSOF_FNM_TYPE "file type"
156 #define LSOF_FID_TCPTPI 'T'
157 #define LSOF_FIX_TCPTPI 24
158 #define LSOF_FNM_TCPTPI "TCP/TPI info"
160 #define LSOF_FID_UID 'u'
161 #define LSOF_FIX_UID 25
162 #define LSOF_FNM_UID "user ID (UID)"
164 #define LSOF_FID_ZONE 'z'
165 #define LSOF_FIX_ZONE 26
166 #define LSOF_FNM_ZONE "zone name"
168 #define LSOF_FID_CNTX 'Z'
169 #define LSOF_FIX_CNTX 27
170 #define LSOF_FNM_CNTX "security context"
172 #define LSOF_FID_TERM '0'
173 #define LSOF_FIX_TERM 28
174 #define LSOF_FNM_TERM "(zero) use NUL field terminator instead of NL"
176 #endif /* !defined(LSOF_FORMAT_H) */