//go:build linux package cosign import ( "io" "syscall" "testing" ) // devvm-cosign makes itself non-dumpable before anything else, so a // process of its user can't read its memory. func TestUndumpable(t *testing.T) { if Main(t.Context(), []string{"-h"}, Env{}, io.Discard) != 0 { t.Fatal("devvm-cosign -h failed") } n, _, errno := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_GET_DUMPABLE, 0, 0) if errno != 0 || n != 0 { t.Errorf("PR_GET_DUMPABLE: %d, %v; want 0", n, errno) } }