Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ fn test_cygwin(target: &str) {
"spawn.h",
"stddef.h",
"stdlib.h",
"stdio.h",
"string.h",
"sys/cpuset.h",
"sys/ioctl.h",
Expand All @@ -614,6 +615,7 @@ fn test_cygwin(target: &str) {
"termios.h",
"unistd.h",
"utime.h",
"utmpx.h",
"wait.h",
"wchar.h",
);
Expand Down
40 changes: 40 additions & 0 deletions src/unix/cygwin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,18 @@ s_no_extra_traits! {
pub ifc_len: c_int,
pub ifc_ifcu: __c_anonymous_ifc_ifcu,
}

pub struct utmpx {
pub ut_type: c_short,
pub ut_pid: pid_t,
pub ut_line: [c_char; UT_LINESIZE],
pub ut_id: [c_char; UT_IDLEN],
pub ut_time: time_t,
pub ut_user: [c_char; UT_NAMESIZE],
pub ut_host: [c_char; UT_HOSTSIZE],
pub ut_addr: c_long,
pub ut_tv: timeval,
}
}

impl siginfo_t {
Expand Down Expand Up @@ -889,6 +901,8 @@ pub const PATH_MAX: c_int = 4096;
pub const PIPE_BUF: usize = 4096;
pub const NGROUPS_MAX: c_int = 1024;

pub const FILENAME_MAX: c_int = 4096;

pub const FORK_RELOAD: c_int = 1;
pub const FORK_NO_RELOAD: c_int = 0;

Expand Down Expand Up @@ -966,6 +980,19 @@ pub const EAI_SOCKTYPE: c_int = 10;
pub const EAI_SYSTEM: c_int = 11;
pub const EAI_OVERFLOW: c_int = 14;

pub const UT_LINESIZE: usize = 16;
pub const UT_NAMESIZE: usize = 16;
pub const UT_HOSTSIZE: usize = 256;
pub const UT_IDLEN: usize = 2;
pub const RUN_LVL: c_short = 1;
pub const BOOT_TIME: c_short = 2;
pub const NEW_TIME: c_short = 3;
pub const OLD_TIME: c_short = 4;
pub const INIT_PROCESS: c_short = 5;
pub const LOGIN_PROCESS: c_short = 6;
pub const USER_PROCESS: c_short = 7;
pub const DEAD_PROCESS: c_short = 8;

pub const POLLIN: c_short = 0x1;
pub const POLLPRI: c_short = 0x2;
pub const POLLOUT: c_short = 0x4;
Expand Down Expand Up @@ -1617,6 +1644,8 @@ pub const _POSIX_VDISABLE: cc_t = 0;
pub const GRND_NONBLOCK: c_uint = 0x1;
pub const GRND_RANDOM: c_uint = 0x2;

pub const _IOFBF: c_int = 0;
pub const _IOLBF: c_int = 1;
pub const _IONBF: c_int = 2;
pub const BUFSIZ: c_int = 1024;

Expand Down Expand Up @@ -2317,6 +2346,7 @@ extern "C" {
winp: *const crate::winsize,
) -> c_int;

pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group;
pub fn getgrgid_r(
gid: crate::gid_t,
grp: *mut crate::group,
Expand All @@ -2330,6 +2360,7 @@ extern "C" {
groups: *mut crate::gid_t,
ngroups: *mut c_int,
) -> c_int;
pub fn getgrnam(name: *const c_char) -> *mut crate::group;
pub fn getgrnam_r(
name: *const c_char,
grp: *mut crate::group,
Expand All @@ -2345,4 +2376,13 @@ extern "C" {
pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int;
pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int;
pub fn fallocate(fd: c_int, mode: c_int, offset: off_t, len: off_t) -> c_int;

pub fn endutxent();
pub fn getutxent() -> *mut utmpx;
pub fn getutxid(id: *const utmpx) -> *mut utmpx;
pub fn getutxline(line: *const utmpx) -> *mut utmpx;
pub fn pututxline(utmpx: *const utmpx) -> *mut utmpx;
pub fn setutxent();
pub fn utmpxname(file: *const c_char) -> c_int;
pub fn updwtmpx(file: *const c_char, utmpx: *const utmpx);
}
1 change: 1 addition & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ cfg_if! {
target_os = "android",
target_os = "openbsd",
target_os = "netbsd",
target_os = "cygwin",
))] {
pub const FNM_NOESCAPE: c_int = 1 << 0;
} else if #[cfg(target_os = "nto")] {
Expand Down
Loading