mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-25 13:35:00 +00:00
inline execve
Signed-off-by: Jean-Francois Roy <jeroy@nvidia.com>
This commit is contained in:
parent
8d8dbd38c3
commit
0c1e76a221
@ -42,11 +42,16 @@ func main() {
|
|||||||
}
|
}
|
||||||
argv := []string{"runc"}
|
argv := []string{"runc"}
|
||||||
argv = append(argv, os.Args[1:]...)
|
argv = append(argv, os.Args[1:]...)
|
||||||
execve(program, argv, os.Environ())
|
if err := unix.Exec(program, argv, os.Environ()); err != nil {
|
||||||
|
log.Fatalf("failed to exec %s: %v", program, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
argv := makeArgv(program)
|
argv := makeArgv(program)
|
||||||
envv := makeEnvv(program)
|
envv := makeEnvv(program)
|
||||||
execve(program+".real", argv, envv)
|
if err := unix.Exec(program+".real", argv, envv); err != nil {
|
||||||
|
log.Fatalf("failed to exec %s: %v", program+".real", err)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func isRuntimeWrapper(program string) bool {
|
func isRuntimeWrapper(program string) bool {
|
||||||
@ -107,9 +112,3 @@ func makeEnvv(program string) []string {
|
|||||||
}
|
}
|
||||||
return append(env, os.Environ()...)
|
return append(env, os.Environ()...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func execve(program string, argv []string, envv []string) {
|
|
||||||
if err := unix.Exec(program, argv, envv); err != nil {
|
|
||||||
log.Fatalf("failed to exec %s: %v", program, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user