Skip to content

Commit 64d954c

Browse files
committed
Auto merge of rust-lang#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 rust-lang#40021
2 parents 0824426 + 02990f2 commit 64d954c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/unix/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ extern {
350350
link_name = "opendir$INODE64$UNIX2003")]
351351
#[cfg_attr(target_os = "netbsd", link_name = "__opendir30")]
352352
pub fn opendir(dirname: *const c_char) -> *mut ::DIR;
353+
#[cfg_attr(target_os = "macos", link_name = "readdir$INODE64")]
354+
#[cfg_attr(target_os = "netbsd", link_name = "__readdir30")]
355+
pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
353356
#[cfg_attr(target_os = "macos", link_name = "readdir_r$INODE64")]
354357
#[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")]
355358
#[cfg_attr(target_os = "solaris", link_name = "__posix_readdir_r")]

src/unix/solaris/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,6 @@ extern {
10381038
result: *mut *mut passwd) -> ::c_int;
10391039
pub fn setpwent();
10401040
pub fn getpwent() -> *mut passwd;
1041-
pub fn readdir(dirp: *mut ::DIR) -> *const ::dirent;
10421041
pub fn fdatasync(fd: ::c_int) -> ::c_int;
10431042
pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
10441043
pub fn duplocale(base: ::locale_t) -> ::locale_t;

0 commit comments

Comments
 (0)