summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-02-22 13:59:54 +0000
committerbors <bors@rust-lang.org>2017-02-22 13:59:54 +0000
commit64d954c6a76e896fbf7ed5c17e77c40e388abe84 (patch)
treecdc8b2cd097c80b533071b89ac208d22b9333a33
parent08244268263fb2ffdb1ce4c7f024f52eba97a2e9 (diff)
parent02990f2fd2801908e0f8e2022270b504c4359829 (diff)
downloadrust-libc-64d954c6a76e896fbf7ed5c17e77c40e388abe84.tar.gz
Auto merge of #533 - raphlinus:master, r=alexcrichton
Make readdir available on all unix targets The readdir_r call has problems, and we'll probably want to move to readdir on many, if not most, unix targets. This patch makes readdir available in unix, rather than just solaris as before. See https://github.com/rust-lang/rust/issues/40021
-rw-r--r--src/unix/mod.rs3
-rw-r--r--src/unix/solaris/mod.rs1
2 files changed, 3 insertions, 1 deletions
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index b2c64a8882..62fc7f5e0a 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -350,6 +350,9 @@ extern {
link_name = "opendir$INODE64$UNIX2003")]
#[cfg_attr(target_os = "netbsd", link_name = "__opendir30")]
pub fn opendir(dirname: *const c_char) -> *mut ::DIR;
+ #[cfg_attr(target_os = "macos", link_name = "readdir$INODE64")]
+ #[cfg_attr(target_os = "netbsd", link_name = "__readdir30")]
+ pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
#[cfg_attr(target_os = "macos", link_name = "readdir_r$INODE64")]
#[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_readdir_r")]
diff --git a/src/unix/solaris/mod.rs b/src/unix/solaris/mod.rs
index 522730b59a..1800a4cb43 100644
--- a/src/unix/solaris/mod.rs
+++ b/src/unix/solaris/mod.rs
@@ -1038,7 +1038,6 @@ extern {
result: *mut *mut passwd) -> ::c_int;
pub fn setpwent();
pub fn getpwent() -> *mut passwd;
- pub fn readdir(dirp: *mut ::DIR) -> *const ::dirent;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
pub fn duplocale(base: ::locale_t) -> ::locale_t;