Skip to content

Commit

Permalink
remove arm64 handling
Browse files Browse the repository at this point in the history
Signed-off-by: leongross <[email protected]>
  • Loading branch information
leongross committed Oct 29, 2024
1 parent 8c69425 commit 70b25d7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 48 deletions.
6 changes: 6 additions & 0 deletions src/os/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import (
"syscall"
)

var (
ErrNotImplementedDir = errors.New("directory setting not implemented")
ErrNotImplementedSys = errors.New("sys setting not implemented")
ErrNotImplementedFiles = errors.New("files setting not implemented")
)

type Signal interface {
String() string
Signal() // to distinguish from other Stringers
Expand Down
8 changes: 1 addition & 7 deletions src/os/exec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build linux && !baremetal && !tinygo.wasm && !arm64
//go:build linux && !baremetal && !tinygo.wasm

package os

Expand All @@ -22,12 +22,6 @@ var (
Kill Signal = syscall.SIGKILL
)

var (
ErrNotImplementedDir = errors.New("directory setting not implemented")
ErrNotImplementedSys = errors.New("sys setting not implemented")
ErrNotImplementedFiles = errors.New("files setting not implemented")
)

// Keep compatible with golang and always succeed and return new proc with pid on Linux.
func findProcess(pid int) (*Process, error) {
return &Process{Pid: pid}, nil
Expand Down
37 changes: 0 additions & 37 deletions src/os/exec_linux_arm64.go

This file was deleted.

7 changes: 5 additions & 2 deletions src/os/exec_linux_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go: build linux && !baremetal && !tinygo.wasm
//go:build linux && !baremetal && !tinygo.wasm

package os_test

Expand All @@ -24,10 +24,13 @@ func TestForkExec(t *testing.T) {
t.Fatalf("forkExec failed: %v", err)
}

if proc == nil {
t.Fatalf("proc is nil")
}

if proc.Pid == 0 {
t.Fatalf("forkExec failed: new process has pid 0")
}
t.Logf("forkExec succeeded: new process has pid %d", proc)
}

func TestForkExecErrNotExist(t *testing.T) {
Expand Down
6 changes: 4 additions & 2 deletions src/os/osexec.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build linux && !baremetal && !tinygo.wasm && !arm64
//go:build linux && !baremetal && !tinygo.wasm

// arm64 does not have a fork syscall, so ignore it for now
// TODO: add support for arm64 with clone or use musl implementation
Expand All @@ -13,7 +13,9 @@ import (
func fork() (pid int32, err error) {
pid = libc_fork()
if pid != 0 {
err = syscall.Errno(*libc_errno())
if errno := *libc_errno(); errno != 0 {
err = syscall.Errno(*libc_errno())
}
}
return
}
Expand Down

0 comments on commit 70b25d7

Please sign in to comment.