Skip to content

Commit

Permalink
Trying to fix syscall
Browse files Browse the repository at this point in the history
  • Loading branch information
grantnelson-wf committed Jun 21, 2024
1 parent 6befd0f commit 0d8aeae
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions tests/testdata/legacy_syscall/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,9 @@ import (
"unsafe"
)

const (
sys_write uintptr = 1 // SYS_WRITE on Linux
stdout uintptr = 1 // file descriptor for stdout
)

func main() {
msg := []byte("Hello, world!\n")
msgPtr := uintptr(unsafe.Pointer(&msg[0]))
msgLen := uintptr(len(msg))
_, _, errno := syscall.Syscall(sys_write, stdout, msgPtr, msgLen)
_, _, errno := syscall.Syscall(1 /* SYS_WRITE on Linux */, 1 /* stdout */, uintptr(unsafe.Pointer(&msg[0])), uintptr(len(msg)))
if errno != 0 {
println(errno.Error())
}
Expand Down

0 comments on commit 0d8aeae

Please sign in to comment.