• Shenghou Ma's avatar
    syscall: workaround Dragonfly BSD kernel exec bug · 5fbd6044
    Shenghou Ma authored
    See also CL 4259056 for FreeBSD.
    
    Test program:
    // exec.go
    package main
    import (
            "log"
            "os"
            "os/exec"
            "runtime"
    )
    func main() {
            path := runtime.GOROOT() + "/src/pkg/net/http/cgi/testdata"
            cmd := &exec.Cmd{
                    Path:   "test.cgi",
                    Args:   []string{path + "/test.cgi"},
                    Dir:    path
                    Stdout: os.Stdout}
            if err := cmd.Start(); err != nil {
                    log.Fatal(err)
            }
            if err := cmd.Wait(); err != nil {
                    log.Fatal(err)
            }
    }
    
    $ go run exec.go
    2014/03/01 15:52:41 fork/exec test.cgi: argument list too long
    
    LGTM=iant
    R=rsc, iant
    CC=golang-codereviews
    https://golang.org/cl/69970044
    5fbd6044
exec_unix.go 7.04 KB