File tree Expand file tree Collapse file tree 5 files changed +16
-48
lines changed
Expand file tree Collapse file tree 5 files changed +16
-48
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ import (
55 "syscall"
66)
77
8+ var (
9+ ErrNotImplementedDir = errors .New ("directory setting not implemented" )
10+ ErrNotImplementedSys = errors .New ("sys setting not implemented" )
11+ ErrNotImplementedFiles = errors .New ("files setting not implemented" )
12+ )
13+
814type Signal interface {
915 String () string
1016 Signal () // to distinguish from other Stringers
Original file line number Diff line number Diff line change 22// Use of this source code is governed by a BSD-style
33// license that can be found in the LICENSE file.
44
5- //go:build linux && !baremetal && !tinygo.wasm && !arm64
5+ //go:build linux && !baremetal && !tinygo.wasm
66
77package os
88
2222 Kill Signal = syscall .SIGKILL
2323)
2424
25- var (
26- ErrNotImplementedDir = errors .New ("directory setting not implemented" )
27- ErrNotImplementedSys = errors .New ("sys setting not implemented" )
28- ErrNotImplementedFiles = errors .New ("files setting not implemented" )
29- )
30-
3125// Keep compatible with golang and always succeed and return new proc with pid on Linux.
3226func findProcess (pid int ) (* Process , error ) {
3327 return & Process {Pid : pid }, nil
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- //go: build linux && !baremetal && !tinygo.wasm
1+ //go:build linux && !baremetal && !tinygo.wasm
22
33package os_test
44
@@ -24,10 +24,13 @@ func TestForkExec(t *testing.T) {
2424 t .Fatalf ("forkExec failed: %v" , err )
2525 }
2626
27+ if proc == nil {
28+ t .Fatalf ("proc is nil" )
29+ }
30+
2731 if proc .Pid == 0 {
2832 t .Fatalf ("forkExec failed: new process has pid 0" )
2933 }
30- t .Logf ("forkExec succeeded: new process has pid %d" , proc )
3134}
3235
3336func TestForkExecErrNotExist (t * testing.T ) {
Original file line number Diff line number Diff line change 1- //go:build linux && !baremetal && !tinygo.wasm && !arm64
1+ //go:build linux && !baremetal && !tinygo.wasm
22
33// arm64 does not have a fork syscall, so ignore it for now
44// TODO: add support for arm64 with clone or use musl implementation
@@ -13,7 +13,9 @@ import (
1313func fork () (pid int32 , err error ) {
1414 pid = libc_fork ()
1515 if pid != 0 {
16- err = syscall .Errno (* libc_errno ())
16+ if errno := * libc_errno (); errno != 0 {
17+ err = syscall .Errno (* libc_errno ())
18+ }
1719 }
1820 return
1921}
You can’t perform that action at this time.
0 commit comments