pub const kinfo_file = extern struct structsize: c_intSize of this record. A zero value is for the sentinel record at the end of an array.
type: c_intDescriptor type.
fd: fd_tArray index.
ref_count: c_intReference count.
flags: c_intFlags.
_pad0: c_int64bit padding.
offset: i64Seek location.
un: extern union { socket: extern struct { /// Sendq size. sendq: u32, /// Socket domain. domain: c_int, /// Socket type. type: c_int, /// Socket protocol. protocol: c_int, /// Socket address. address: sockaddr.storage, /// Peer address. peer: sockaddr.storage, /// Address of so_pcb. pcb: u64, /// Address of inp_ppcb. inpcb: u64, /// Address of unp_conn. unpconn: u64, /// Send buffer state. snd_sb_state: u16, /// Receive buffer state. rcv_sb_state: u16, /// Recvq size. recvq: u32, }, file: extern struct { /// Vnode type. type: i32, // Reserved for future use _spare1: [3]i32, _spare2: [30]u64, /// Vnode filesystem id. fsid: u64, /// File device. rdev: u64, /// Global file id. fileid: u64, /// File size. size: u64, /// fsid compat for FreeBSD 11. fsid_freebsd11: u32, /// rdev compat for FreeBSD 11. rdev_freebsd11: u32, /// File mode. mode: u16, // 64bit padding. _pad0: u16, _pad1: u32, }, sem: extern struct { _spare0: [4]u32, _spare1: [32]u64, /// Semaphore value. value: u32, /// Semaphore mode. mode: u16, }, pipe: extern struct { _spare1: [4]u32, _spare2: [32]u64, addr: u64, peer: u64, buffer_cnt: u32, // 64bit padding. kf_pipe_pad0: [3]u32, }, proc: extern struct { _spare1: [4]u32, _spare2: [32]u64, pid: pid_t, }, eventfd: extern struct { value: u64, flags: u32, }, }status: u16Status flags.
_pad1: u1632-bit alignment padding.
_spare: c_intReserved for future use.
cap_rights: cap_rightsCapability rights.
_cap_spare: u64Reserved for future cap_rights
path: [PATH_MAX]u8Path to file, if any.
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259pub const kinfo_file = extern struct {
/// Size of this record.
/// A zero value is for the sentinel record at the end of an array.
structsize: c_int,
/// Descriptor type.
type: c_int,
/// Array index.
fd: fd_t,
/// Reference count.
ref_count: c_int,
/// Flags.
flags: c_int,
// 64bit padding.
_pad0: c_int,
/// Seek location.
offset: i64,
un: extern union {
socket: extern struct {
/// Sendq size.
sendq: u32,
/// Socket domain.
domain: c_int,
/// Socket type.
type: c_int,
/// Socket protocol.
protocol: c_int,
/// Socket address.
address: sockaddr.storage,
/// Peer address.
peer: sockaddr.storage,
/// Address of so_pcb.
pcb: u64,
/// Address of inp_ppcb.
inpcb: u64,
/// Address of unp_conn.
unpconn: u64,
/// Send buffer state.
snd_sb_state: u16,
/// Receive buffer state.
rcv_sb_state: u16,
/// Recvq size.
recvq: u32,
},
file: extern struct {
/// Vnode type.
type: i32,
// Reserved for future use
_spare1: [3]i32,
_spare2: [30]u64,
/// Vnode filesystem id.
fsid: u64,
/// File device.
rdev: u64,
/// Global file id.
fileid: u64,
/// File size.
size: u64,
/// fsid compat for FreeBSD 11.
fsid_freebsd11: u32,
/// rdev compat for FreeBSD 11.
rdev_freebsd11: u32,
/// File mode.
mode: u16,
// 64bit padding.
_pad0: u16,
_pad1: u32,
},
sem: extern struct {
_spare0: [4]u32,
_spare1: [32]u64,
/// Semaphore value.
value: u32,
/// Semaphore mode.
mode: u16,
},
pipe: extern struct {
_spare1: [4]u32,
_spare2: [32]u64,
addr: u64,
peer: u64,
buffer_cnt: u32,
// 64bit padding.
kf_pipe_pad0: [3]u32,
},
proc: extern struct {
_spare1: [4]u32,
_spare2: [32]u64,
pid: pid_t,
},
eventfd: extern struct {
value: u64,
flags: u32,
},
},
/// Status flags.
status: u16,
// 32-bit alignment padding.
_pad1: u16,
// Reserved for future use.
_spare: c_int,
/// Capability rights.
cap_rights: cap_rights,
/// Reserved for future cap_rights
_cap_spare: u64,
/// Path to file, if any.
path: [PATH_MAX]u8,
comptime {
assert(@sizeOf(@This()) == KINFO_FILE_SIZE);
assert(@alignOf(@This()) == @sizeOf(u64));
}
}