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

std: Handle ENOSYS when calling pipe2 #42521

Merged
merged 1 commit into from
Jun 9, 2017
Merged

Conversation

alexcrichton
Copy link
Member

Should help fix an accidental regression from #39386.

@rust-highfive
Copy link
Collaborator

r? @brson

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

@alexcrichton alexcrichton added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jun 8, 2017
@alexcrichton
Copy link
Member Author

Nominating for a beta backport as this is technically a regression from 1.17.0

// Note that despite calling a glibc function here we may still get
// ENOSYS, see
// https://github.com/rust-lang/rust/pull/39386#issuecomment-306970390
// for more info.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not just copy the info here? I.e. "...may still get ENOSYS if the kernel is too old for pipe2 as glibc unconditionally defines the pipe2 symbol as a thin syscall wrapper."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure yeah!

@aidanhs aidanhs added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 8, 2017
Copy link
Member

@cuviper cuviper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@tbu-
Copy link
Contributor

tbu- commented Jun 8, 2017

This undoes what #39386 tried to do: You can save the ENOSYS failure of pipe2 in a global atomic boolean (with relaxed semantics) so you won't try pipe2 over and over again if it doesn't exist.

@cuviper
Copy link
Member

cuviper commented Jun 8, 2017

Ah, that was before the advice to ignore ENOSYS. An atomic flag seems fine, and is already used in a few other CLOEXEC fallbacks, but it seems frustrating that these aren't more consistent.

Should help fix an accidental regression from rust-lang#39386.
@alexcrichton
Copy link
Member Author

@bors: r=cuviper

@bors
Copy link
Contributor

bors commented Jun 8, 2017

📌 Commit 44e6406 has been approved by cuviper

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Jun 8, 2017
std: Handle ENOSYS when calling `pipe2`

Should help fix an accidental regression from rust-lang#39386.
bors added a commit that referenced this pull request Jun 8, 2017
Rollup of 6 pull requests

- Successful merges: #42307, #42385, #42487, #42491, #42521, #42531
- Failed merges:
@bors
Copy link
Contributor

bors commented Jun 9, 2017

⌛ Testing commit 44e6406 with merge a7ac71b...

bors added a commit that referenced this pull request Jun 9, 2017
std: Handle ENOSYS when calling `pipe2`

Should help fix an accidental regression from #39386.
@bors
Copy link
Contributor

bors commented Jun 9, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: cuviper
Pushing a7ac71b to master...

@bors bors merged commit 44e6406 into rust-lang:master Jun 9, 2017
@brson brson added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jun 12, 2017
@brson brson mentioned this pull request Jun 12, 2017
@brson brson removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jun 13, 2017
@alexcrichton alexcrichton deleted the enosys branch June 14, 2017 18:40
bors added a commit that referenced this pull request Jun 15, 2017
Beta next

- #42521
- #42512
- #42482
- #42481
- #42480

r? @nikomatsakis remember to untag 'beta-nominated' on linked issues
cuviper added a commit to cuviper/jobserver-rs that referenced this pull request Jan 9, 2018
Just because libc has the symbol, doesn't mean the kernel supports it.

Based on rust-lang/rust#42521.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants