Skip to content

Commit fafbc4e

Browse files
committed
posix shadow api for haiku
1 parent 5d228ea commit fafbc4e

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

src/unix/haiku/mod.rs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,18 @@ s! {
370370
pub dlpi_tls_modid: usize,
371371
pub dlpi_tls_data: *mut ::c_void,
372372
}
373+
374+
pub struct spwd {
375+
pub sp_namp: *mut ::c_char,
376+
pub sp_pwdp: *mut ::c_char,
377+
pub sp_lstchg: ::c_int,
378+
pub sp_min: ::c_int,
379+
pub sp_max: ::c_int,
380+
pub sp_warn: ::c_int,
381+
pub sp_inact: ::c_int,
382+
pub sp_expire: ::c_int,
383+
pub sp_flag: ::c_int,
384+
}
373385
}
374386

375387
s_no_extra_traits! {
@@ -1516,6 +1528,35 @@ extern "C" {
15161528
timeout: *const ::timespec,
15171529
sigMask: *const sigset_t,
15181530
) -> ::c_int;
1531+
1532+
pub fn getspent() -> *mut spwd;
1533+
pub fn getspent_r(pwd: *mut spwd, buf: *mut ::c_char, bufferSize: ::size_t) -> ::c_int;
1534+
pub fn setspent();
1535+
pub fn endspent();
1536+
pub fn getspnam(name: *const ::c_char) -> *mut spwd;
1537+
pub fn getspnam_r(
1538+
name: *const ::c_char,
1539+
spwd: *mut spwd,
1540+
buffer: *mut ::c_char,
1541+
bufferSize: ::size_t,
1542+
res: *mut *mut spwd,
1543+
) -> ::c_int;
1544+
pub fn sgetspent(line: *const ::c_char) -> *mut spwd;
1545+
pub fn sgetspent_r(
1546+
line: *const ::c_char,
1547+
spwd: *mut spwd,
1548+
buffer: *mut ::c_char,
1549+
bufferSize: ::size_t,
1550+
res: *mut *mut spwd,
1551+
) -> ::c_int;
1552+
pub fn fgetspent(file: *mut ::FILE) -> *mut spwd;
1553+
pub fn fgetspent_r(
1554+
file: *mut ::FILE,
1555+
spwd: *mut spwd,
1556+
buffer: *mut ::c_char,
1557+
bufferSize: ::size_t,
1558+
res: *mut *mut spwd,
1559+
) -> ::c_int;
15191560
}
15201561

15211562
#[link(name = "bsd")]

0 commit comments

Comments
 (0)