Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrOverrideReadOnly = overrideReadOnlyErr(syscall.EACCES)
var ErrProcPidPathHidden = procPidPathHiddenErr(syscall.ENOENT)
Functions ¶
func GetRelatedPIDs ¶
GetRelatedPIDs calls callback for all the related pids: all parents and children, including pid itself. procPath is typically "/proc"
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
func (*FS) Statfs ¶
func (f *FS) Statfs(ctx context.Context, req *fuse.StatfsRequest, resp *fuse.StatfsResponse) error
type ProcInfo ¶
type ProcInfo procInfo
func EmptyMountInfo ¶
func EmptyMountInfo() ProcInfo
EmptyMountInfo returns empty contents for /proc/PID/mountinfo files. This can be prudent when employing RestrictMounts.
func EmptyMountStats ¶
func EmptyMountStats() ProcInfo
EmptyMountStats returns empty contents for /proc/PID/mountstats files.
func MemInfo ¶
MemInfo limits the memory reported by /proc/meminfo Note that this is a very naive implementation and might not reflect actual free or available memory.
func NewProcInfo ¶
func RestrictMounts ¶
RestrictMounts excludes mounts not under path from /proc/PID/mounts (and /proc/mounts) empty string can be used to exclude all mounts. reroot can be used to re-root the mounts under path, or empty string to use actual path. For example: RestrictMounts("/foo/bar", "/qux") will exclude "/hello" and convert "/foo/bar/baz" into "/qux/baz"