File tree 5 files changed +16
-48
lines changed
5 files changed +16
-48
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ import (
5
5
"syscall"
6
6
)
7
7
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
+
8
14
type Signal interface {
9
15
String () string
10
16
Signal () // to distinguish from other Stringers
Original file line number Diff line number Diff line change 2
2
// Use of this source code is governed by a BSD-style
3
3
// license that can be found in the LICENSE file.
4
4
5
- //go:build linux && !baremetal && !tinygo.wasm && !arm64
5
+ //go:build linux && !baremetal && !tinygo.wasm
6
6
7
7
package os
8
8
22
22
Kill Signal = syscall .SIGKILL
23
23
)
24
24
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
-
31
25
// Keep compatible with golang and always succeed and return new proc with pid on Linux.
32
26
func findProcess (pid int ) (* Process , error ) {
33
27
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
2
2
3
3
package os_test
4
4
@@ -24,10 +24,13 @@ func TestForkExec(t *testing.T) {
24
24
t .Fatalf ("forkExec failed: %v" , err )
25
25
}
26
26
27
+ if proc == nil {
28
+ t .Fatalf ("proc is nil" )
29
+ }
30
+
27
31
if proc .Pid == 0 {
28
32
t .Fatalf ("forkExec failed: new process has pid 0" )
29
33
}
30
- t .Logf ("forkExec succeeded: new process has pid %d" , proc )
31
34
}
32
35
33
36
func 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
2
2
3
3
// arm64 does not have a fork syscall, so ignore it for now
4
4
// TODO: add support for arm64 with clone or use musl implementation
@@ -13,7 +13,9 @@ import (
13
13
func fork () (pid int32 , err error ) {
14
14
pid = libc_fork ()
15
15
if pid != 0 {
16
- err = syscall .Errno (* libc_errno ())
16
+ if errno := * libc_errno (); errno != 0 {
17
+ err = syscall .Errno (* libc_errno ())
18
+ }
17
19
}
18
20
return
19
21
}
You can’t perform that action at this time.
0 commit comments