Skip to content

Commit 74085fa

Browse files
committed
Fix poll API for MacOS and BSD
Signed-off-by: David Henningsson <diwic@ubuntu.com>
1 parent a6c6688 commit 74085fa

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

src/unix/bsd/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub type blkcnt_t = i64;
66
pub type socklen_t = u32;
77
pub type sa_family_t = u8;
88
pub type pthread_t = ::uintptr_t;
9+
pub type nfds_t = ::c_uint;
910

1011
s! {
1112
pub struct sockaddr {

src/unix/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ pub type in_addr_t = u32;
1010
pub type in_port_t = u16;
1111
pub type sighandler_t = ::size_t;
1212
pub type cc_t = ::c_uchar;
13-
pub type nfds_t = ::c_ulong;
1413

1514
pub enum DIR {}
1615

@@ -562,6 +561,8 @@ extern {
562561
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
563562
link_name = "recvmsg$UNIX2003")]
564563
pub fn recvmsg(fd: ::c_int, msg: *mut msghdr, flags: ::c_int) -> ::ssize_t;
564+
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
565+
link_name = "poll$UNIX2003")]
565566
pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int;
566567
}
567568

src/unix/notbsd/android/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub type sigset_t = c_ulong;
2222
pub type time64_t = i64;
2323
pub type fsfilcnt_t = ::c_ulong;
2424
pub type fsblkcnt_t = ::c_ulong;
25+
pub type nfds_t = ::c_uint;
2526

2627
s! {
2728
pub struct stat {

src/unix/notbsd/linux/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub type fsfilcnt_t = ::c_ulong;
1414
pub type key_t = ::c_int;
1515
pub type shmatt_t = ::c_ulong;
1616
pub type mqd_t = ::c_int;
17+
pub type nfds_t = ::c_ulong;
1718

1819
pub enum fpos64_t {} // TODO: fill this out with a struct
1920

0 commit comments

Comments
 (0)