sys

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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