Documentation ¶
Overview ¶
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
Constants ¶
This section is empty.
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.
Types ¶
Click to show internal directories.
Click to hide internal directories.