@@ -22,6 +22,8 @@ pub type tcflag_t = ::c_uint;
22
22
pub type time_t = :: c_long ;
23
23
pub type wchar_t = :: c_int ;
24
24
pub type nfds_t = :: c_ulong ;
25
+ pub type projid_t = :: c_int ;
26
+ pub type zoneid_t = :: c_int ;
25
27
26
28
pub type suseconds_t = :: c_long ;
27
29
pub type off_t = :: c_long ;
@@ -46,6 +48,15 @@ impl ::Clone for timezone {
46
48
}
47
49
}
48
50
51
+ #[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
52
+ pub enum ucred_t { }
53
+ impl :: Copy for ucred_t { }
54
+ impl :: Clone for ucred_t {
55
+ fn clone ( & self ) -> ucred_t {
56
+ * self
57
+ }
58
+ }
59
+
49
60
s ! {
50
61
pub struct in_addr {
51
62
pub s_addr: :: in_addr_t,
@@ -2582,6 +2593,28 @@ extern "C" {
2582
2593
2583
2594
pub fn ntp_adjtime ( buf : * mut timex ) -> :: c_int ;
2584
2595
pub fn ntp_gettime ( buf : * mut ntptimeval ) -> :: c_int ;
2596
+
2597
+ pub fn ucred_get ( pid : :: pid_t ) -> * mut ucred_t ;
2598
+ pub fn getpeerucred ( fd : :: c_int , ucred : * mut * mut ucred_t ) -> :: c_int ;
2599
+
2600
+ pub fn ucred_free ( ucred : * mut ucred_t ) ;
2601
+
2602
+ pub fn ucred_geteuid ( ucred : * const ucred_t ) -> :: uid_t ;
2603
+ pub fn ucred_getruid ( ucred : * const ucred_t ) -> :: uid_t ;
2604
+ pub fn ucred_getsuid ( ucred : * const ucred_t ) -> :: uid_t ;
2605
+ pub fn ucred_getegid ( ucred : * const ucred_t ) -> :: gid_t ;
2606
+ pub fn ucred_getrgid ( ucred : * const ucred_t ) -> :: gid_t ;
2607
+ pub fn ucred_getsgid ( ucred : * const ucred_t ) -> :: gid_t ;
2608
+ pub fn ucred_getgroups (
2609
+ ucred : * const ucred_t ,
2610
+ groups : * mut * const :: gid_t ,
2611
+ ) -> :: c_int ;
2612
+ pub fn ucred_getpid ( ucred : * const ucred_t ) -> :: pid_t ;
2613
+ pub fn ucred_getprojid ( ucred : * const ucred_t ) -> projid_t ;
2614
+ pub fn ucred_getzoneid ( ucred : * const ucred_t ) -> zoneid_t ;
2615
+ pub fn ucred_getpflags ( ucred : * const ucred_t , flags : :: c_uint ) -> :: c_uint ;
2616
+
2617
+ pub fn ucred_size ( ) -> :: size_t ;
2585
2618
}
2586
2619
2587
2620
mod compat;
0 commit comments