utils

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearBit added in v0.11.0

func ClearBit(n *uint64, offset uint)

func ClearBits added in v0.11.0

func ClearBits(n *uint64, mask uint64)

func CopyRegularFileByPath added in v0.8.2

func CopyRegularFileByPath(src, dst string) error

CopyRegularFileByPath copies a file from src to dst

func CopyRegularFileByRelativePath added in v0.8.2

func CopyRegularFileByRelativePath(srcName string, dstDir *os.File, dstName string) error

CopyRegularFileByRelativePath copies a file from src to dst, where destination is relative to a given directory. This function needs needed capabilities to be set before it is called.

func CreateAt added in v0.8.2

func CreateAt(dir *os.File, relativePath string) (*os.File, error)

CreateAt implements the same logic as os.Create using directory FD and relative path.

func Dup added in v0.8.2

func Dup(file *os.File) (*os.File, error)

Dup is a wrapper function to the `dup` syscall using golang types.

func HasBit added in v0.11.0

func HasBit(n uint64, offset uint) bool

func IsDirEmpty added in v0.10.0

func IsDirEmpty(pathname string) (bool, error)

IsDirEmpty returns true if directory contains no files

func Max added in v0.11.0

func Max(x, y uint64) uint64

func Min added in v0.11.0

func Min(x, y uint64) uint64

func MkdirAt added in v0.8.2

func MkdirAt(dir *os.File, relativePath string, perm fs.FileMode) error

MkdirAt is a wrapper function to the `mkdirat` syscall using golang types.

func MkdirAtExist added in v0.8.2

func MkdirAtExist(dir *os.File, relativePath string, perm fs.FileMode) error

MkdirAtExist is a wrapper function to the `mkdirat` syscall using golang types, ignoring EEXIST error.

func OpenAt added in v0.8.2

func OpenAt(dir *os.File, relativePath string, flags int, perm fs.FileMode) (*os.File, error)

OpenAt is a wrapper function to the `openat` syscall using golang types.

func OpenExistingDir added in v0.8.2

func OpenExistingDir(p string) (*os.File, error)

OpenExistingDir open a directory with given path, and return the os.File of it.

func ParseSymbol

func ParseSymbol(address uint64, table helpers.KernelSymbolTable) *helpers.KernelSymbol

func RemoveAt added in v0.14.1

func RemoveAt(dir *os.File, relativePath string, flags int) error

RemoveAt is a wrapper function to the `unlinkat` syscall using golang types.

func RenameAt added in v0.8.2

func RenameAt(olddir *os.File, oldpath string, newdir *os.File, newpath string) error

RenameAt is a wrapper function to the `renameat` syscall using golang types.

func SetBit added in v0.11.0

func SetBit(n *uint64, offset uint)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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