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

RLERROR doesn't work across architectures #35

Open
geofft opened this issue Jul 19, 2017 · 3 comments
Open

RLERROR doesn't work across architectures #35

geofft opened this issue Jul 19, 2017 · 3 comments

Comments

@geofft
Copy link

geofft commented Jul 19, 2017

Hi, I'm not sure if this is the right place to file this - this is a spec issue, is this upstream for the spec?

RLERROR transmits the numeric errno, which isn't consistent across all Linux architectures. For instance, errno 95 is EOPNOTSUPP on most architectures including x86_64, but is, e.g., ENOTSOCK on MIPS. So if I'm running a MIPS guest connecting to qemu's 9p server on an x86_64 host, and I mount with 9p2000.L, executing any file gives me "Socket operation on non-socket" because the kernel wants to look up the security.capability xattr, and the server is returning errno 95.

Adding if (err == -95) err = -EOPNOTSUPP; to two spots in the Linux 9p client causes it to start working, but I'm not sure that's the right solution. (So does mounting with 9p2000.u.)

I see that the FreeBSD support commit in diod also needed to hard-code errno 95. Probably one approach would be to specify that errnos are interpreted following Linux's include/uapi/asm-generic/errno.h, which is used on most architectures, and require those that don't (Linux alpha, mips, parisc, sparc, and other OSes like FreeBSD) to translate them to/from the asm-generic version.

@garlick
Copy link
Member

garlick commented Jul 19, 2017

Hi Geoff - maybe try https://sourceforge.net/projects/v9fs/lists/v9fs-users

I had to go check, e.g. http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_03 but it does seem like POSIX offers no help standardizing errno values other than zero. At least not that I found in a quick search.

@andrewchambers
Copy link

I have written a rust client for diod at https://github.com/andrewchambers/p92000-rust - I found this issue too so just created my own errno definitions based on the generic error codes.

I think the protocol.md spec should probably clarify this point.

@garlick
Copy link
Member

garlick commented Jun 2, 2022

Yup agreed.

Great project by the way! I hope you get to your secondary goal of writing a rust 9p server - that would be cool!

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

No branches or pull requests

3 participants