Skip to content

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

libc-test/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ fn test_cygwin(target: &str) {
592592
"spawn.h",
593593
"stddef.h",
594594
"stdlib.h",
595+
"stdio.h",
595596
"string.h",
596597
"sys/cpuset.h",
597598
"sys/ioctl.h",
@@ -614,6 +615,7 @@ fn test_cygwin(target: &str) {
614615
"termios.h",
615616
"unistd.h",
616617
"utime.h",
618+
"utmpx.h",
617619
"wait.h",
618620
"wchar.h",
619621
);

src/unix/cygwin/mod.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,18 @@ s_no_extra_traits! {
509509
pub ifc_len: c_int,
510510
pub ifc_ifcu: __c_anonymous_ifc_ifcu,
511511
}
512+
513+
pub struct utmpx {
514+
pub ut_type: c_short,
515+
pub ut_pid: pid_t,
516+
pub ut_line: [c_char; UT_LINESIZE],
517+
pub ut_id: [c_char; UT_IDLEN],
518+
pub ut_time: time_t,
519+
pub ut_user: [c_char; UT_NAMESIZE],
520+
pub ut_host: [c_char; UT_HOSTSIZE],
521+
pub ut_addr: c_long,
522+
pub ut_tv: timeval,
523+
}
512524
}
513525

514526
impl siginfo_t {
@@ -889,6 +901,8 @@ pub const PATH_MAX: c_int = 4096;
889901
pub const PIPE_BUF: usize = 4096;
890902
pub const NGROUPS_MAX: c_int = 1024;
891903

904+
pub const FILENAME_MAX: c_int = 4096;
905+
892906
pub const FORK_RELOAD: c_int = 1;
893907
pub const FORK_NO_RELOAD: c_int = 0;
894908

@@ -966,6 +980,19 @@ pub const EAI_SOCKTYPE: c_int = 10;
966980
pub const EAI_SYSTEM: c_int = 11;
967981
pub const EAI_OVERFLOW: c_int = 14;
968982

983+
pub const UT_LINESIZE: usize = 16;
984+
pub const UT_NAMESIZE: usize = 16;
985+
pub const UT_HOSTSIZE: usize = 256;
986+
pub const UT_IDLEN: usize = 2;
987+
pub const RUN_LVL: c_short = 1;
988+
pub const BOOT_TIME: c_short = 2;
989+
pub const NEW_TIME: c_short = 3;
990+
pub const OLD_TIME: c_short = 4;
991+
pub const INIT_PROCESS: c_short = 5;
992+
pub const LOGIN_PROCESS: c_short = 6;
993+
pub const USER_PROCESS: c_short = 7;
994+
pub const DEAD_PROCESS: c_short = 8;
995+
969996
pub const POLLIN: c_short = 0x1;
970997
pub const POLLPRI: c_short = 0x2;
971998
pub const POLLOUT: c_short = 0x4;
@@ -1617,6 +1644,8 @@ pub const _POSIX_VDISABLE: cc_t = 0;
16171644
pub const GRND_NONBLOCK: c_uint = 0x1;
16181645
pub const GRND_RANDOM: c_uint = 0x2;
16191646

1647+
pub const _IOFBF: c_int = 0;
1648+
pub const _IOLBF: c_int = 1;
16201649
pub const _IONBF: c_int = 2;
16211650
pub const BUFSIZ: c_int = 1024;
16221651

@@ -2317,6 +2346,7 @@ extern "C" {
23172346
winp: *const crate::winsize,
23182347
) -> c_int;
23192348

2349+
pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group;
23202350
pub fn getgrgid_r(
23212351
gid: crate::gid_t,
23222352
grp: *mut crate::group,
@@ -2330,6 +2360,7 @@ extern "C" {
23302360
groups: *mut crate::gid_t,
23312361
ngroups: *mut c_int,
23322362
) -> c_int;
2363+
pub fn getgrnam(name: *const c_char) -> *mut crate::group;
23332364
pub fn getgrnam_r(
23342365
name: *const c_char,
23352366
grp: *mut crate::group,
@@ -2345,4 +2376,13 @@ extern "C" {
23452376
pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int;
23462377
pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int;
23472378
pub fn fallocate(fd: c_int, mode: c_int, offset: off_t, len: off_t) -> c_int;
2379+
2380+
pub fn endutxent();
2381+
pub fn getutxent() -> *mut utmpx;
2382+
pub fn getutxid(id: *const utmpx) -> *mut utmpx;
2383+
pub fn getutxline(line: *const utmpx) -> *mut utmpx;
2384+
pub fn pututxline(utmpx: *const utmpx) -> *mut utmpx;
2385+
pub fn setutxent();
2386+
pub fn utmpxname(file: *const c_char) -> c_int;
2387+
pub fn updwtmpx(file: *const c_char, utmpx: *const utmpx);
23482388
}

0 commit comments

Comments
 (0)