close
The Wayback Machine - https://web.archive.org/web/20201016173827/https://github.com/ziglang/zig/pull/5745
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

map EBADF to error values for read and write #5745

Merged
merged 3 commits into from Aug 20, 2020
Merged

Conversation

@lun-4
Copy link
Contributor

@lun-4 lun-4 commented Jun 28, 2020

Closes #3880.

I took a peek at the other syscall wrappers around std.os and found inconsistencies on what EBADF means for them. Some declare EBADF as "not open file descriptor" (fchdir, lseek, llseek), or "not valid open file descriptor" (mmap), and others put their own meanings as well (fcntl, unlinkat, mkdirat, fstatat), which makes me think about if we should return error values on those calls too.

Also, I didn't change anything regarding WASI errors. WASI maps errors as well.

lib/std/os.zig Show resolved Hide resolved
@kubkon
kubkon approved these changes Jun 29, 2020
Copy link
Member

@kubkon kubkon left a comment

LGTM!

@haze
haze approved these changes Jul 19, 2020
Copy link
Contributor

@haze haze left a comment

LGTM

@andrewrk andrewrk merged commit b1c7334 into ziglang:master Aug 20, 2020
3 checks passed
3 checks passed
builds.sr.ht: freebsd.yml builds.sr.ht job completed successfully
Details
continuous-integration/drone/pr Build is passing
Details
ziglang.zig #20200702.4 succeeded
Details
@andrewrk
Copy link
Member

@andrewrk andrewrk commented Aug 20, 2020

Thanks @lun-4 for your patience on this one. Good stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.