Well it builds on aarch64, won't on anything else

This commit is contained in:
Artemis Tosini 2023-10-21 18:50:21 +00:00
parent da633ee396
commit a08c65d942
Signed by: artemist
GPG key ID: EE5227935FE3FF18
8 changed files with 10 additions and 9 deletions

View file

@ -38,8 +38,8 @@
#define SYS_wait4 260
// CONSTANT SYS_execve 221
#define SYS_execve 221
// CONSTANT SYS_fchmod 52
#define SYS_fchmod 52
// CONSTANT SYS_fchmodat 53
#define SYS_fchmodat 53
// CONSTANT SYS_faccessat 48
#define SYS_faccessat 48
// CONSTANT SYS_brk 234

View file

@ -26,7 +26,7 @@
int
_open3 (char const *file_name, int flags, int mask)
{
int r = _sys_call3 (SYS_open, (long) file_name, (int) flags, (int) mask);
int r = _sys_call4 (SYS_openat, (long) -100, (long) file_name, (int) flags, (int) mask);
if (r > 2)
{
__ungetc_clear (r);

View file

@ -27,5 +27,5 @@ access (char const *file_name, int how)
{
long long_file_name = cast_charp_to_long (file_name);
long long_how = cast_int_to_long (how);
return _sys_call2 (SYS_access, long_file_name, long_how);
return _sys_call4 (SYS_faccessat, -100, long_file_name, long_how, 0);
}

View file

@ -26,5 +26,5 @@ dup2 (int old, int new)
{
long long_old = old;
long long_new = new;
return _sys_call2 (SYS_dup2, long_old, long_new);
return _sys_call3 (SYS_dup3, long_old, long_new, 0);
}

View file

@ -24,5 +24,6 @@
int
fork ()
{
return _sys_call (SYS_fork);
/* We don't have a _sys_call5 but this works */
return _sys_call6 (SYS_clone, 17, 0, 0, 0, 0, 0);
}

View file

@ -26,5 +26,5 @@ int
unlink (char const *file_name)
{
long long_file_name = cast_charp_to_long (file_name);
return _sys_call1 (SYS_unlink, long_file_name);
return _sys_call3 (SYS_unlinkat, -100, long_file_name, 0);
}

View file

@ -27,5 +27,5 @@ chmod (char const *file_name, int mask)
{
long long_file_name = file_name;
long long_mask = mask;
return _sys_call2 (SYS_chmod, long_file_name, long_mask);
return _sys_call2 (SYS_fchmodat, -100, long_file_name, long_mask, 0);
}

View file

@ -27,7 +27,7 @@
int
open (char *file_name, int flags, int mask)
{
int r = _sys_call3 (SYS_open, file_name, flags, mask);
int r = _sys_call4 (SYS_openat, -100, file_name, flags, mask);
if (r > 2)
__ungetc_clear (r);
return r;