Skip to content

Commit

Permalink
Auto merge of #533 - raphlinus:master, r=alexcrichton
Browse files Browse the repository at this point in the history
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/rust#40021
  • Loading branch information
bors committed Feb 22, 2017
2 parents 0824426 + 02990f2 commit 64d954c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
1 change: 0 additions & 1 deletion src/unix/solaris/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 64d954c

Please sign in to comment.