syscall

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DisableCgocheck = func() error {
	for _, dv := range dbgVars {
		if dv.name == "cgocheck" {
			*dv.value = 0
			return nil
		}
	}
	return errors.New("can't disable cgocheck. Set environment GODEBUG=cgocheck=0 or use -pin switch to generate call library")
}

DisableCgocheck disables go runtime feature to check embedded pointers to go memory. This function links private variable from go runtime to change variable value and may break in any future versions for Go. Use new flag -pin to generate Pinned memory guards available in go1.21

Functions

func FreeLibrary

func FreeLibrary(dll Handle)

FreeLibrary releases previously loaded library

func GetProcAddress

func GetProcAddress(dll Handle, exportName string) (trap uintptr, err error)

Retrieve address to exported function

func SyscallL

func SyscallL(trap uintptr, args ...uintptr) uintptr

SyscallL invoke function retrieved with GetProcAddress

func SyscallN added in v0.9.1

func SyscallN(trap uintptr, args ...uintptr) (r0 uintptr, r1 uintptr, err error)

SyscallN with matching signature to Windows one. r1 will always be 0 and err nil

Types

type Handle

type Handle uintptr

func LoadLibrary

func LoadLibrary(libraryPath string) (Handle, error)

LoadLibrary load shared object file (.so) and gives a handle to it. If libraryPath name looks like Windows DLL name (is has .dll extension) it will be converted to Linux equivalent Like someapi.dll -> libsomeapi.so

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL