diff options
author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-08-12 13:19:46 +0200 |
---|---|---|
committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-08-12 13:55:27 +0200 |
commit | 70b385894251abb7a51a0a58c96a46f3cc29055d (patch) | |
tree | e828c3846ecb50ba685dae5706d788087a252fed | |
parent | a1d629881edb608c10c3fc07223de1377b0ee262 (diff) | |
download | rust-libc-70b385894251abb7a51a0a58c96a46f3cc29055d.tar.gz |
Add more items in BSD
-rw-r--r-- | src/unix/bsd/apple/mod.rs | 44 | ||||
-rw-r--r-- | src/unix/bsd/mod.rs | 1 |
2 files changed, 45 insertions, 0 deletions
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index bf422c2046..255b383e70 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -678,6 +678,47 @@ s! { pub sched_priority: ::c_int, __opaque: [::c_char; 4], } + + pub struct vinfo_stat { + pub vst_dev: u32, + pub vst_mode: u16, + pub vst_nlink: u16, + pub vst_ino: u64, + pub vst_uid: ::uid_t, + pub vst_gid: ::gid_t, + pub vst_atime: i64, + pub vst_atimensec: i64, + pub vst_mtime: i64, + pub vst_mtimensec: i64, + pub vst_ctime: i64, + pub vst_ctimensec: i64, + pub vst_birthtime: i64, + pub vst_birthtimensec: i64, + pub vst_size: ::off_t, + pub vst_blocks: i64, + pub vst_blksize: i32, + pub vst_flags: u32, + pub vst_gen: u32, + pub vst_rdev: u32, + pub vst_qspare: [i64; 2], + } + + pub struct vnode_info { + pub vi_stat: vinfo_stat, + pub vi_type: ::c_int, + pub vi_pad: ::c_int, + pub vi_fsid: ::fsid_t, + } + + pub struct vnode_info_path { + pub vip_vi: vnode_info, + pub vip_path: [::c_char; ::MAXPATHLEN as usize], + } + + pub struct proc_vnodepathinfo { + pub pvi_cdir: vnode_info_path, + pub pvi_rdir: vnode_info_path, + } } s_no_extra_traits! { @@ -3530,8 +3571,11 @@ pub const RTAX_MAX: ::c_int = 8; pub const KERN_PROCARGS2: ::c_int = 49; pub const PROC_PIDTASKALLINFO: ::c_int = 2; +pub const PROC_PIDTBSDINFO: ::c_int = 3; pub const PROC_PIDTASKINFO: ::c_int = 4; pub const PROC_PIDTHREADINFO: ::c_int = 5; +pub const PROC_PIDVNODEPATHINFO: ::c_int = 9; +pub const PROC_PIDPATHINFO_MAXSIZE: ::c_int = 4096; pub const MAXCOMLEN: usize = 16; pub const MAXTHREADNAMESIZE: usize = 64; diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index df4cd40c3a..81bcc4d8d0 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -253,6 +253,7 @@ pub const FIOSETOWN: ::c_ulong = 0x8004667c; pub const FIOGETOWN: ::c_ulong = 0x4004667b; pub const PATH_MAX: ::c_int = 1024; +pub const MAXPATHLEN: ::c_int = PATH_MAX; pub const IOV_MAX: ::c_int = 1024; |