mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Fix some more issues
- ARM Neon headers are now exported in libc/isystem/ - stat() and access() now do a better job reporting which files are executable which ones aren't. They do this by reading the first two bytes in a file to see if it's `MZ` or `#!`.
This commit is contained in:
parent
22cf6e11eb
commit
4f5d5a6813
17 changed files with 144 additions and 49 deletions
|
@ -61,7 +61,7 @@ TEST(access, test) {
|
|||
}
|
||||
|
||||
TEST(access, testRequestWriteOnReadOnly_returnsEaccess) {
|
||||
return; /* TODO(jart): maybe we need root to help? */
|
||||
if (1) return; // TODO(jart): maybe we need root to help?
|
||||
ASSERT_SYS(ENOENT, -1, access("file", F_OK));
|
||||
ASSERT_SYS(0, 0, close(creat("file", 0444)));
|
||||
ASSERT_SYS(0, 0, access("file", F_OK));
|
||||
|
@ -76,3 +76,8 @@ TEST(access, testRequestWriteOnReadOnly_returnsEaccess) {
|
|||
TEST(access, runThisExecutable) {
|
||||
ASSERT_SYS(0, 0, access(GetProgramExecutableName(), R_OK | X_OK));
|
||||
}
|
||||
|
||||
TEST(access, textFileIsntExecutable) {
|
||||
ASSERT_SYS(0, 0, touch("foo.txt", 0644));
|
||||
ASSERT_SYS(EACCES, -1, access("foo.txt", R_OK | X_OK));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue