Skip to content

syscall.Syscall error #1862

@visualfc

Description

@visualfc

error on macOS ( pass on linux )

package main

import (
	"fmt"
	"syscall"
	"unsafe"
)

func main() {
	// Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)
	msg := []byte("Hello from Syscall!\n")
	r1, r2, err := syscall.Syscall(
		syscall.SYS_WRITE,                
		1,                                // fd = stdout
		uintptr(unsafe.Pointer(&msg[0])), 
		uintptr(len(msg)),       
	)
	fmt.Printf("r1=%d, r2=%d, err=%v\n", r1, r2, err)
}

llgo run main.go

signal: bad system call

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions