def do_build(self, output_file, cgroup_file):
pid = fork()
if not pid:
chdir('/out')
os_close(STDIN_FILENO)
if output_file:
fd = os_open(output_file, O_WRONLY)
dup2(fd, STDOUT_FILENO)
dup2(fd, STDERR_FILENO)
os_close(fd)
if cgroup_file:
enter_cgroup(cgroup_file)
execve(self.compiler_file, self.compiler_args, SPAWN_ENV)
return wait_and_reap_zombies(pid)
评论列表
文章目录