Closed dram closed 7 years ago
After adding a new file plat/linux/libsys/execve.c
with following content, previous example can be compiled successfully:
#include <unistd.h>
#include "libsys.h"
int execve(const char *path, char *const argv[], char *const envp[])
{
return _syscall(__NR_execve, (quad) path, (quad) argv, (quad) envp);
}
The signature is copy from Open Group Base Specifications. Not sure if it also needs to be added to plat/linux396/include/unistd.h
and plat/linuxppc/include/unistd.h
.
BTW, I'm curious and can not figure out the relation between plat
and mach
directory, as I also find file i386/libsys/execve.s
in mach
.
I kind of think that declaration is needed for unistd.h
, which is needed for C code when using this function.
Create a PR #32 for this system call.
PR merged. Thanks!
The files in mach/i386/libsys were for some old system, perhaps Xenix. (A comment in mach/i386/cv/cv.c mentions "XENIX386".) We can't use them with Linux. Now the plat/ directory has libsys and boot.s for our current platforms, while mach/ has assemblers and code generators. But mach/ also has artifacts like old libsys.
Linux has many system calls, and our libsys still doesn't provide most of them.
When compiling following code:
ACK reports an error: