mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 00:08:11 +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 = 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)
|
||||
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 {
|
||||
@ -107,9 +112,3 @@ func makeEnvv(program string) []string {
|
||||
}
|
||||
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