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: Limit the read/write size on Darwin #6333

Merged
merged 1 commit into from
Sep 13, 2020
Merged

Conversation

LemonBoy
Copy link
Contributor

It turns out that the kernel won't read or write more than 0x7fffffff
bytes in a single call, failing with EINVAL when trying to do so.

Adjust the limit and curse whoever is responsible for this.

Closes #6332

See also rust-lang/rust#38590 and python/cpython#9937, the man pages don't mention this limitation at all...

It turns out that the kernel won't read or write more than 0x7fffffff
bytes in a single call, failing with EINVAL when trying to do so.

Adjust the limit and curse whoever is responsible for this.

Closes ziglang#6332
@daurnimator daurnimator added os-macos standard library This issue involves writing Zig code for the standard library. labels Sep 13, 2020
@andrewrk
Copy link
Member

Argh, the API supports short writes, they could have just written 0x7fffffff bytes and returned that value!

Copy link
Member

@andrewrk andrewrk left a comment

Choose a reason for hiding this comment

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

Just waiting on a confirmation from @gaultier (or anyone who can test on a mac) to make sure the value is correct here

@gaultier
Copy link

Nice to see such a fast fix!
I have built the fix locally and can confirm it works !
Awesome 👍

As an aside it is non trivial to build zig from source on OSX these days due to llvm shenanigans.

Thanks!

@andrewrk
Copy link
Member

andrewrk commented Sep 13, 2020

As an aside it is non trivial to build zig from source on OSX these days due to llvm shenanigans.

Yep. We'll get there. Unfortunately with LLVM as a dependency, they have the power to mess up our build. If this doesn't get worked out with the next release cycle then it may be worth promoting our bootstrap repository as the main way to get up and running. Here's hoping that LLVM 11 fixes all the problems introduced with LLVM 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os-macos standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Read whole file fails on OSX if the file is ~5Gb in size and above
4 participants