fssyscall

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package fssyscall abstracts syscall file descriptors across platform.Handles

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FLockEx added in v0.5.2

func FLockEx(f *os.File) error

FLockEx attempts to create an advisory exclusive lock on the file associated to the given *os.File.

func FTryLockEx added in v0.5.2

func FTryLockEx(f *os.File) error

FTryLockEx attempts to create an advisory exclusive lock on the file associated to the given *os.File without blocking. Returns an error if the lock cannot be acquired immediately.

func FUnlockEx added in v0.5.2

func FUnlockEx(f *os.File) error

FUnlockEx releases an advisory lock on the file associated with the given *os.File.

func LockEx

func LockEx(h Handle) error

LockEx attempts to create an advisory exclusive lock on the file associated to the given Handle.

func TryLockEx added in v0.5.2

func TryLockEx(h Handle) error

TryLockEx attempts to create an advisory exclusive lock on the file associated to the given Handle without blocking. Returns syscall.EBUSY if the lock cannot be acquired immediately.

func UnlockEx

func UnlockEx(h Handle) error

UnlockEx releases an advisory lock on the file associated with the given Handle.

Types

type Handle

type Handle int

Handle represents a OS specific file descriptor

const ZeroHandle Handle = -1

ZeroHandle represents a closed Handle

func Open

func Open(filename string, mode int, perm fs.FileMode) (Handle, error)

Open performs syscall.Open returning a Handle

func (Handle) Close

func (h Handle) Close() error

Close attempts to close the file associated to the Handle

func (Handle) IsZero

func (h Handle) IsZero() bool

IsZero indicates the Handle doesn't refer to a possibly valid descriptor

func (Handle) Sys

func (h Handle) Sys() int

Sys returns the underlying type for syscall operations

Jump to

Keyboard shortcuts

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