Skip to content

std: Handle ENOSYS when calling pipe2#42521

Merged
bors merged 1 commit into
rust-lang:masterfrom
alexcrichton:enosys
Jun 9, 2017
Merged

std: Handle ENOSYS when calling pipe2#42521
bors merged 1 commit into
rust-lang:masterfrom
alexcrichton:enosys

Conversation

@alexcrichton

Copy link
Copy Markdown
Member

Should help fix an accidental regression from #39386.

@rust-highfive

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member Author

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

Comment thread src/libstd/sys/unix/pipe.rs Outdated

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

@cuviper cuviper left a comment

Copy link
Copy Markdown
Member

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-

tbu- commented Jun 8, 2017

Copy link
Copy Markdown
Contributor

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

cuviper commented Jun 8, 2017

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

@bors: r=cuviper

@bors

bors commented Jun 8, 2017

Copy link
Copy Markdown
Collaborator

📌 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

bors commented Jun 9, 2017

Copy link
Copy Markdown
Collaborator

⌛ 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

bors commented Jun 9, 2017

Copy link
Copy Markdown
Collaborator

☀️ 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