1 // Copyright 2019 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd
17 func TestExecPtrace(t
*testing
.T
) {
18 testenv
.MustHaveExec(t
)
20 bin
, err
:= exec
.LookPath("sh")
22 t
.Skipf("skipped because sh is not available")
26 Sys
: &syscall
.SysProcAttr
{
30 proc
, err
:= os
.StartProcess(bin
, []string{bin
}, attr
)
34 if err
!= nil && !os
.IsPermission(err
) {
35 t
.Fatalf("StartProcess with ptrace enabled failed: %v", err
)