-
Notifications
You must be signed in to change notification settings - Fork 6
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
Unable to open() a readonly file O_RDONLY #125
Comments
This might be a duplicate of #124. |
Looking at the code in open.c, I can't see why it would fail. I've called stat() on the same file and the return value is 0. |
You mention a file mode of 33024, which is octal 100400. So i assume you are trying this either on an ext2 partition (but then you would be using mint), or using the GEMDOS emulation of Hatari? |
Just a TOS partition (real hardware) |
I'm not sure whether that is the cause of the problem, but as noted in #124, the open() routine is compiled using <sys/stat.h> from mintlib, which is completely different (mintlib uses a structure as expected by the mint Fstat64() call). |
That sounds very likely now - when I compiled my test stub using sys/stat.h (from mintlib), st_mode was 1 |
Given a write protected regular file (e.g. with st_mode = 33024),
the following fails:
fd = open(fname, O_RDONLY, 0)
On return fd is -1 and errno is EACCESS (36)
Tested on TOS 2.06
The text was updated successfully, but these errors were encountered: