@@ -337,6 +337,79 @@ s! {
337
337
__unused1: * mut :: c_void, //actually a function pointer
338
338
pub sigev_notify_attributes: * mut :: pthread_attr_t
339
339
}
340
+
341
+ pub struct proc_taskinfo {
342
+ pub pti_virtual_size: u64 ,
343
+ pub pti_resident_size: u64 ,
344
+ pub pti_total_user: u64 ,
345
+ pub pti_total_system: u64 ,
346
+ pub pti_threads_user: u64 ,
347
+ pub pti_threads_system: u64 ,
348
+ pub pti_policy: i32 ,
349
+ pub pti_faults: i32 ,
350
+ pub pti_pageins: i32 ,
351
+ pub pti_cow_faults: i32 ,
352
+ pub pti_messages_sent: i32 ,
353
+ pub pti_messages_received: i32 ,
354
+ pub pti_syscalls_mach: i32 ,
355
+ pub pti_syscalls_unix: i32 ,
356
+ pub pti_csw: i32 ,
357
+ pub pti_threadnum: i32 ,
358
+ pub pti_numrunning: i32 ,
359
+ pub pti_priority: i32 ,
360
+ }
361
+
362
+ pub struct proc_bsdinfo {
363
+ pub pbi_flags: u32 ,
364
+ pub pbi_status: u32 ,
365
+ pub pbi_xstatus: u32 ,
366
+ pub pbi_pid: u32 ,
367
+ pub pbi_ppid: u32 ,
368
+ pub pbi_uid: :: uid_t,
369
+ pub pbi_gid: :: gid_t,
370
+ pub pbi_ruid: :: uid_t,
371
+ pub pbi_rgid: :: gid_t,
372
+ pub pbi_svuid: :: uid_t,
373
+ pub pbi_svgid: :: gid_t,
374
+ pub rfu_1: u32 ,
375
+ pub pbi_comm: [ :: c_char; MAXCOMLEN ] ,
376
+ pub pbi_name: [ :: c_char; 32 ] , // MAXCOMLEN * 2, but macro isn't happy...
377
+ pub pbi_nfiles: u32 ,
378
+ pub pbi_pgid: u32 ,
379
+ pub pbi_pjobc: u32 ,
380
+ pub e_tdev: u32 ,
381
+ pub e_tpgid: u32 ,
382
+ pub pbi_nice: i32 ,
383
+ pub pbi_start_tvsec: u64 ,
384
+ pub pbi_start_tvusec: u64 ,
385
+ }
386
+
387
+ pub struct proc_taskallinfo {
388
+ pub pbsd: proc_bsdinfo,
389
+ pub ptinfo: proc_taskinfo,
390
+ }
391
+
392
+ pub struct proc_threadinfo {
393
+ pub pth_user_time: u64 ,
394
+ pub pth_system_time: u64 ,
395
+ pub pth_cpu_usage: i32 ,
396
+ pub pth_policy: i32 ,
397
+ pub pth_run_state: i32 ,
398
+ pub pth_flags: i32 ,
399
+ pub pth_sleep_time: i32 ,
400
+ pub pth_curpri: i32 ,
401
+ pub pth_priority: i32 ,
402
+ pub pth_maxpriority: i32 ,
403
+ pub pth_name: [ :: c_char; MAXTHREADNAMESIZE ] ,
404
+ }
405
+
406
+ pub struct xsw_usage {
407
+ pub xsu_total: u64 ,
408
+ pub xsu_avail: u64 ,
409
+ pub xsu_used: u64 ,
410
+ pub xsu_pagesize: u32 ,
411
+ pub xsu_encrypted: :: boolean_t,
412
+ }
340
413
}
341
414
342
415
pub const _UTX_USERSIZE: usize = 256 ;
@@ -1541,6 +1614,14 @@ pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020;
1541
1614
pub const NET_RT_IFLIST2 : :: c_int = 0x0006 ;
1542
1615
pub const RTM_IFINFO2 : :: c_int = 0x0012 ;
1543
1616
1617
+ pub const KERN_PROCARGS2 : :: c_int = 49 ;
1618
+
1619
+ pub const PROC_PIDTASKALLINFO : :: c_int = 2 ;
1620
+ pub const PROC_PIDTASKINFO : :: c_int = 4 ;
1621
+ pub const PROC_PIDTHREADINFO : :: c_int = 5 ;
1622
+ pub const MAXCOMLEN : usize = 16 ;
1623
+ pub const MAXTHREADNAMESIZE : usize = 64 ;
1624
+
1544
1625
f ! {
1545
1626
pub fn WSTOPSIG ( status: :: c_int) -> :: c_int {
1546
1627
status >> 8
0 commit comments