syscall

package
v0.0.86 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNumFiles added in v0.0.37

func GetNumFiles() (uint64, uint64, error)

func KillBatch

func KillBatch(pids []int, sig syscall.Signal) (errorPids []int, err error)

func SetMaxNumFiles added in v0.0.37

func SetMaxNumFiles() (uint64, error)

func SetNumFiles added in v0.0.37

func SetNumFiles(maxOpenFiles uint64) error

SetNumFiles sets the linux rlimit for the maximum open files.

Types

type DiskUsage added in v0.0.75

type DiskUsage struct {
	// contains filtered or unexported fields
}

func NewDiskUsage added in v0.0.75

func NewDiskUsage(path string) (*DiskUsage, error)

func (*DiskUsage) Avail added in v0.0.75

func (du *DiskUsage) Avail() uint64

Avail returns total avail bytes on file system

func (*DiskUsage) Free added in v0.0.75

func (du *DiskUsage) Free() uint64

Free returns total free bytes on file system

func (*DiskUsage) Size added in v0.0.75

func (du *DiskUsage) Size() uint64

Size returns total size of the file system

func (*DiskUsage) Usage added in v0.0.75

func (du *DiskUsage) Usage() float32

Usage returns percentage of used on the file system

https://github.com/coreutils/coreutils/blob/master/src/df.c#:~:text=pct%20%3D%20u100%20/%20nonroot_total%20%2B%20(u100%20%25%20nonroot_total%20!%3D%200)%3B By default, ext2/3/4 filesystems reserve 5% of the space to be useable only by root. This is to avoid a normal user completely filling the disk which would then cause system components to fail whenever they next needed to write to the disk

func (*DiskUsage) Used added in v0.0.75

func (du *DiskUsage) Used() uint64

Size returns total used bytes on the file system

Jump to

Keyboard shortcuts

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