Skip to content

Commit 5878a4b

Browse files
committed
remove arm64 handling
Signed-off-by: leongross <[email protected]>
1 parent 70bfa96 commit 5878a4b

File tree

5 files changed

+16
-48
lines changed

5 files changed

+16
-48
lines changed

src/os/exec.go

+6
Original file line numberDiff line numberDiff 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+
814
type Signal interface {
915
String() string
1016
Signal() // to distinguish from other Stringers

src/os/exec_linux.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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

77
package os
88

@@ -22,12 +22,6 @@ var (
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.
3226
func findProcess(pid int) (*Process, error) {
3327
return &Process{Pid: pid}, nil

src/os/exec_linux_arm64.go

-37
This file was deleted.

src/os/exec_linux_test.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go: build linux && !baremetal && !tinygo.wasm
1+
//go:build linux && !baremetal && !tinygo.wasm
22

33
package 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

3336
func TestForkExecErrNotExist(t *testing.T) {

src/os/osexec.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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 (
1313
func 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
}

0 commit comments

Comments
 (0)