Skip to content

Commit

Permalink
Make readdir available on all unix targets
Browse files Browse the repository at this point in the history
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
raphlinus committed Feb 21, 2017
1 parent 8d8264b commit e010078
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) -> *const ::dirent;
#[cfg_attr(target_os = "macos", link_name = "readdir_r$INODE64")]
#[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")]
pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent,
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 @@ -1017,7 +1017,6 @@ extern {
buflen: ::c_int) -> *const passwd;
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 e010078

Please sign in to comment.