Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This fixes issue #1318 - on Solarish systems __posix_readdir_r is only #1319

Merged
merged 3 commits into from
Apr 20, 2019
Merged

This fixes issue #1318 - on Solarish systems __posix_readdir_r is only #1319

merged 3 commits into from
Apr 20, 2019

Conversation

jasonbking
Copy link
Contributor

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).

defined for 32-bit Solarish targets.  Since rust doesn't currently
support 32-bit Solarish targets, the line is both unnecessary and wrong.
@rust-highfive
Copy link

r? @gnzlbg

(rust_highfive has picked a reviewer for you, use r? to override)

@gnzlbg
Copy link
Contributor

gnzlbg commented Apr 17, 2019

It would be nice if someone with solaris experience could take a look, maybe @bgermann ?

@jasonbking
Copy link
Contributor Author

It can be confirmed by running nm on /lib/libc.so vs. /lib/amd64/libc.so on a Solaris system (the former should have __posix_readdir_r while the latter (the 64-bit lib) will not. Due to all the symbol gymnastics in dirent.h, it's very easy to miss the difference if you just try looking at the the header file.

@jasonbking
Copy link
Contributor Author

I would be surprised if Solaris has changed behavior. This appears to have been the case since at least 2006 (looking at what symbols are exported in libc in the commit history which goes back to the OpenSolaris launch) which predates the Solaris/illumos split, and was strictly for backwards compatibility.

It looks like what happened was prior to 64-bit systems arriving on the scene, the interface was changed by POSIX, so the old interface (taking only two arguments) was left for backwards compatibility, while the final POSIX standard interface was added (using some header tricks for new programs to use the new version -- __posix_readdir_r) as well as the large file variant for 32-bit apps. Since 64-bit apps post-date the interface change, only the final POSIX version was exposed for 64-bit applications.

@bgermann
Copy link
Contributor

The change is accurate. Please also see
https://docs.oracle.com/cd/E36784_01/html/E36873/libc-3lib.html and
https://www.unix.com/man-page/opensolaris/3LIB/libc/
which list __posix_readdir_r at a section titled "The following interfaces are unique to the 32-bit version of this library"

@gnzlbg
Copy link
Contributor

gnzlbg commented Apr 18, 2019 via email

@jasonbking
Copy link
Contributor Author

Sure -- would something like

/// 64-bit Solaris and illumos libc only has readdir_r.  A 32-bit Solaris or illumos target (if ever created)
/// should use __posix_readdir_r.  See libc(3LIB) on Solaris or illumos (https://illumos.org/man/3lib/libc).

work? I figure it'll be easier to hash out the wording here than do a lot of churn on the PR. I used the illumos man link since that's likely to be a more stable URL than docs.oracle.com (I think they've reorganized things at least once or twice on that site, making older links no longer work).

@gnzlbg
Copy link
Contributor

gnzlbg commented Apr 18, 2019

I'd rather err in the side of too many links, and add the links that @bgermann mentioned to the comment as well, but otherwise LGTM. I'll merge when the PR is updated. Thank you both!

@gnzlbg
Copy link
Contributor

gnzlbg commented Apr 20, 2019

@bors: r+

@bors
Copy link
Contributor

bors commented Apr 20, 2019

📌 Commit e45fa4a has been approved by gnzlbg

@bors
Copy link
Contributor

bors commented Apr 20, 2019

⌛ Testing commit e45fa4a with merge dfda3b0...

bors added a commit that referenced this pull request Apr 20, 2019
This fixes issue #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).
@bors
Copy link
Contributor

bors commented Apr 20, 2019

☀️ Test successful - checks-cirrus, checks-travis, status-appveyor
Approved by: gnzlbg
Pushing dfda3b0 to master...

@bors bors merged commit e45fa4a into rust-lang:master Apr 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants