syscallExt

package
v0.0.0-...-f277093 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package syscall provides additional functionality on top of the standard syscall library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLockFile

func CreateLockFile(path string) (int, error)

CreateLockFile creates a lock file and returns its file descriptor

func FileExists

func FileExists(path string) bool

FileExists checks if a file exists using syscalls

func GetCPUCount

func GetCPUCount() int

GetCPUCount returns the number of CPUs

func GetOSType

func GetOSType() string

GetOSType returns the current operating system type

func GetPID

func GetPID() int

GetPID returns the process ID of the current process

func GetPPID

func GetPPID() int

GetPPID returns the parent process ID of the current process

func GetPriority

func GetPriority(pid int) (int, error)

GetPriority gets the process priority

func GetSystemInfo

func GetSystemInfo() (string, error)

GetSystemInfo returns basic system information

func ReleaseLockFile

func ReleaseLockFile(fd int, path string) error

ReleaseLockFile releases a lock file by file descriptor

func SetPriority

func SetPriority(pid, priority int) error

SetPriority sets the process priority

func Timeout

func Timeout(timeout time.Duration, f func() error) error

Timeout executes a function with a timeout

Types

type Error

type Error struct {
	Op   string
	Err  error
	Path string
}

Error wraps syscall errors with additional context

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap returns the underlying error

Jump to

Keyboard shortcuts

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