mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Reduce memory requirements for execve()
This commit is contained in:
parent
eaca5b3e81
commit
21e1023d28
7 changed files with 35 additions and 32 deletions
|
@ -47,11 +47,8 @@ textwindows int execve$nt(const char *program, char *const argv[],
|
|||
close(i);
|
||||
}
|
||||
}
|
||||
for (i = 0; argv[i];) ++i;
|
||||
i = (i + 1) * sizeof(char *);
|
||||
argv = memcpy(alloca(i), argv, i);
|
||||
memcpy(argv, &program, sizeof(program));
|
||||
rc = ntspawn(argv, envp, NULL, NULL, true, 0, NULL, &startinfo, &procinfo);
|
||||
rc = ntspawn(program, argv, envp, NULL, NULL, true, 0, NULL, &startinfo,
|
||||
&procinfo);
|
||||
if (rc == -1) return -1;
|
||||
CloseHandle(procinfo.hThread);
|
||||
do {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue