Skip to content

Commit a812f82

Browse files
committed
fix aarch64 build
1 parent 3a938b4 commit a812f82

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/access.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#pragma once
2+
3+
#include <asm/unistd.h>
4+
5+
#define R_OK 4
6+
#define AT_FDCWD (-100)
7+
int access(const char *pathname, int mode) {
8+
return my_syscall4(__NR_faccessat, AT_FDCWD, (long)pathname, mode, 0);
9+
}

src/nix-ld.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
#include <nolibc.h>
66

7-
#include "strerror.h"
87
#include <stdio.h>
98
#include <config.h>
109

10+
#include "strerror.h"
11+
#include "access.h"
12+
1113
#define alloca __builtin_alloca
1214

1315
static inline void closep(const int *fd) { close(*fd); }
@@ -387,10 +389,6 @@ static void* get_at_base(size_t *auxv) {
387389
return NULL;
388390
}
389391

390-
#define R_OK 4
391-
int access(const char *pathname, int mode) {
392-
return my_syscall2(__NR_access, (long)pathname, mode);
393-
}
394392

395393
int main(int argc, char** argv, char** envp) {
396394
size_t *auxv;

0 commit comments

Comments
 (0)