1// Copyright 2020 The Chromium OS Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5// +build !libc_exec 6 7package main 8 9import ( 10 "os/exec" 11 "syscall" 12) 13 14// Implement exec for users that don't need to dynamically link with glibc 15// See b/144783188 and libc_exec.go. 16 17func execCmd(env env, cmd *command) error { 18 execCmd := exec.Command(cmd.Path, cmd.Args...) 19 mergedEnv := mergeEnvValues(env.environ(), cmd.EnvUpdates) 20 21 ret := syscall.Exec(execCmd.Path, execCmd.Args, mergedEnv) 22 return newErrorwithSourceLocf("exec error: %v", ret) 23} 24