Skip to content

Commit dfda3b0

Browse files
committed
Auto merge of rust-lang#1319 - jasonbking:readdir, r=gnzlbg
This fixes issue rust-lang#1318 - on Solarish systems __posix_readdir_r is only defined for 32-bit Solarish targets. Since rust doesn't currently support 32-bit Solarish targets, the line is both unnecessary and wrong. As found with the latest fd binary, removing the line fixed the fd build (and fd then works as expected).
2 parents a79c2d4 + e45fa4a commit dfda3b0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/unix/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,13 @@ extern {
612612
pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
613613
#[cfg_attr(target_os = "macos", link_name = "readdir_r$INODE64")]
614614
#[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")]
615-
#[cfg_attr(any(target_os = "solaris", target_os = "illumos"),
616-
link_name = "__posix_readdir_r")]
617615
#[cfg_attr(target_os = "freebsd", link_name = "readdir_r@FBSD_1.0")]
616+
/// The 64-bit libc on Solaris and illumos only has readdir_r. If a
617+
/// 32-bit Solaris or illumos target is ever created, it should use
618+
/// __posix_readdir_r. See libc(3LIB) on Solaris or illumos:
619+
/// https://illumos.org/man/3lib/libc
620+
/// https://docs.oracle.com/cd/E36784_01/html/E36873/libc-3lib.html
621+
/// https://www.unix.com/man-page/opensolaris/3LIB/libc/
618622
pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent,
619623
result: *mut *mut ::dirent) -> ::c_int;
620624
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),

0 commit comments

Comments
 (0)