package fsutil
import "gvisor.dev/gvisor/pkg/fsutil"
Package fsutil contains filesystem utilities that can be shared between the sentry and other sandbox components.
Index ¶
- Variables
- func DirentNames(dirfd int) ([]string, error)
- func ForEachDirent(dirfd int, handleDirent DirentHandler) error
- func ParseDirents(buf []byte, handleDirent DirentHandler)
- func RenameAt(oldDirFD int, oldName string, newDirFD int, newName string) error
- func StatAt(dirFd int, name string) (unix.Stat_t, error)
- func Utimensat(dirFd int, name string, times [2]unix.Timespec, flags int) error
- type DirentHandler
Variables ¶
UnixDirentMaxSize is the maximum size of unix.Dirent in bytes.
Functions ¶
func DirentNames ¶
DirentNames retrieves all dirents from dirfd using getdents64(2) and returns all the recorded dirent names.
func ForEachDirent ¶
func ForEachDirent(dirfd int, handleDirent DirentHandler) error
ForEachDirent retrieves all dirents from dirfd using getdents64(2) and invokes handleDirent on them.
func ParseDirents ¶
func ParseDirents(buf []byte, handleDirent DirentHandler)
ParseDirents parses dirents from buf. buf must have been populated by getdents64(2) syscall. It calls the handleDirent callback for each dirent.
func RenameAt ¶
RenameAt is a convenience wrapper to make the renameat(2) syscall. It additionally handles empty names.
func StatAt ¶
StatAt is a convenience wrapper around newfstatat(2).
func Utimensat ¶
Utimensat is a convenience wrapper to make the utimensat(2) syscall. It additionally handles empty name.
Types ¶
type DirentHandler ¶
DirentHandler is a function that handles a dirent.
Source Files ¶
fsutil.go fsutil_amd64_unsafe.go fsutil_unsafe.go
- Version
- v0.0.0-20250605235530-a6711d1e1dc6 (latest)
- Published
- Jun 5, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 4 hours ago –
Tools for package owners.