Odin
Odin copied to clipboard
[sys/linux] Fix fork and execve syscalls on arm64
This PR does the following things:
- Adds flag parameter to execveat syscall
- Adds clone syscall
- Uses execveat procedure in execve syscall on arm64
- Uses clone procedure in fork syscall on arm64
Fixes #3472 Fixes #3487
The syscalls have been implemented based on the ChromiumOS docs
Is there a particular reason as to why the execve syscall is not used on arm64? It does exist and run completely fine on my Pinebook Pro. I considered changing the execveat syscall to execve on arm64 in the execve procedure.
Is there a particular reason as to why the
execvesyscall is not used on arm64? It does exist and run completely fine on my Pinebook Pro. I considered changing theexecveatsyscall toexecveon arm64 in the execve procedure.
I believe this one may have been assumed =]
It's not uncommon for arm64 to only have the *at version of the syscall. I wonder if we should just use the *at functions for everything as it would get rid of all the when business. Everyone has those functions. Here is the entirety of the difference between open and openat in the Linux source code:
SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode)
{
if (force_o_largefile())
flags |= O_LARGEFILE;
return do_sys_open(AT_FDCWD, filename, flags, mode);
}
SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags,
umode_t, mode)
{
if (force_o_largefile())
flags |= O_LARGEFILE;
return do_sys_open(dfd, filename, flags, mode);
}
@flysand7 I made the requested changes. Is there still something that needs to be changed?
@gingerBill looks good to merge
@flysand7 What should that type be in the conflict?
@gingerBill I can't see what the conflict is, so... no idea
Execve_Flags does not exist. Should I create a bit_set that uses FD_Flags_Bits?
https://github.com/odin-lang/Odin/pull/3476/files#diff-988793090a86cbbc5126181f239031996412c074c814e90738c6aa08e57b5d25R1310
@flysand7 done