Ophestra Umiker
cc816a1aaa
All checks were successful
test / test (push) Successful in 37s
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
14 lines
258 B
Go
14 lines
258 B
Go
package proc
|
|
|
|
import (
|
|
"os"
|
|
"os/exec"
|
|
)
|
|
|
|
func ExtraFile(cmd *exec.Cmd, f *os.File) (fd uintptr) {
|
|
// ExtraFiles: If non-nil, entry i becomes file descriptor 3+i.
|
|
fd = uintptr(3 + len(cmd.ExtraFiles))
|
|
cmd.ExtraFiles = append(cmd.ExtraFiles, f)
|
|
return
|
|
}
|