-
Notifications
You must be signed in to change notification settings - Fork 353
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
macOS: Implement stat64 to get rid of the termcap hack #999
Comments
I can try that locally. Two questions:
After some testing, we can't remove it:
The |
Sure, why not.
IIRC I just had to ran it.
Ah, that's right. The surface-level function here is |
I can try to implement that shim. I've seen that function used in other parts of |
You really don't want me to ever be done reviewing all your stuff, do you? I am already not keeping up.^^ But yes, please do. Juts throttle your PR output a bit maybe? :D |
Hahahahaha. I think we will be back to normal after the current round of PRs. |
Also see rust-lang/rust#65094 |
rust-lang/rust#65094 landed, so the shim you'll want to implement is |
I suppose that I was also thinking that a lot of information returned by both functions won't be available (and AFAIK it is not visible from |
No that doesn't sound right... we would tell the user their program has UB when really we just didn't emulate the shim properly. We could default it all to 0... |
Shouldn't that produce unexpected behavior silently? |
Yeah, maybe. OTOH I am not sure how much is really guaranteed for inodes. And when the host is Unix we can do the proper thing. People have done API emulations before so maybe there's a way to get something "inode-like" on Windows. |
I'll do an initial version with just the information that is exposed from |
There is something else beyond implementing
I looked up for the syscall and the name is |
Syscall 332 is statx on x86_64 Linux, not compat_pwritev64: That makes sense, as libstd calls statx using a syscall directly: |
oh lol, thank you! |
@christianpoveda any update on this? Would be great to get rid of that hack. |
uhh yeah I forgot... sorry. I'll try to do a PR in a few days |
Reopening as the issue remains for macOS. |
We've done an advance by implementing
I'm almost certain this is happening because we are using The "error cannot be transformed into a raw os error" is because there is no platform agnostic way of taking that error (which probably has kind Also this particular error is happening in |
To me, the actual bug seems to be that we fail to propagate the error to the client? Like, what we should do is set errno and return -1, right? The code in question ignores failures in But, why does this |
I think it has something to do with the termcap file specifically:
|
According to apple's manual:
maybe the termcap file is in a FS where this is not implemented? I'm unfamiliar with this. |
The failure is inside Do we do the syncing also on files that are opened read-only? Would it maybe make sense to not do it there? |
yes we always sync. I could store the access mode to the file in the Edit: I checked the possible errors for close
|
Sounds like a good plan to me. |
We added this hack when env var exposure was implemented to avoid breakage:
https://github.com/rust-lang/miri/blob/master/src/shims/env.rs#L22-L23
However, since then @christianpoveda implemented basic file system access. So do we even still need that hack?
The text was updated successfully, but these errors were encountered: