mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 11:37:35 +00:00
16 lines
519 B
C
16 lines
519 B
C
#ifndef COSMOPOLITAN_LIBC_LINUX_EXECVE_H_
|
|
#define COSMOPOLITAN_LIBC_LINUX_EXECVE_H_
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
|
|
forceinline long LinuxExecve(const char *program, char *const argv[],
|
|
char *const envp[]) {
|
|
long rc;
|
|
asm volatile("syscall"
|
|
: "=a"(rc)
|
|
: "0"(59), "D"(program), "S"(argv), "d"(envp)
|
|
: "rcx", "r11", "memory");
|
|
return rc;
|
|
}
|
|
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
#endif /* COSMOPOLITAN_LIBC_LINUX_EXECVE_H_ */
|