sys

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package sys is an internal package that contains helper methods for dealing with Linux that are more complicated than basic wrappers. Basic wrappers usually belong in internal/linux. If you feel something belongs in libcontainer/utils or libcontainer/system, it probably belongs here instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FchmodFile

func FchmodFile(f *os.File, mode uint32) error

FchmodFile is a wrapper around fchmodat2(AT_EMPTY_PATH) with fallbacks for older kernels. This is distinct from [File.Chmod] and unix.Fchmod in that it works on O_PATH file descriptors.

func FchownFile

func FchownFile(f *os.File, uid, gid int) error

FchownFile is a wrapper around fchownat(AT_EMPTY_PATH). This is distinct from [File.Chown] and unix.Fchown in that it works on O_PATH file descriptors.

func VerifyInode

func VerifyInode(file *os.File, checkFunc VerifyInodeFunc) error

VerifyInode verifies that the underlying inode for the given file matches an expected inode type (possibly on a particular kind of filesystem). This is mainly a wrapper around VerifyInodeFunc.

func WriteSysctls

func WriteSysctls(sysctls map[string]string) error

WriteSysctls sets the given sysctls to the requested values.

Types

type VerifyInodeFunc

type VerifyInodeFunc func(stat *unix.Stat_t, statfs *unix.Statfs_t) error

VerifyInodeFunc is the callback passed to VerifyInode to check if the inode is the expected type (and on the correct filesystem type, in the case of filesystem-specific inodes).

Jump to

Keyboard shortcuts

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