package system
import "github.com/opencontainers/runc/libcontainer/system"
Index ¶
- Constants
- func ClearKeepCaps() error
- func Execv(cmd string, args []string, env []string) error
- func GetClockTicks() int
- func GetParentNSeuid() int64
- func GetProcessStartTime(pid int) (string, error)
- func GetSubreaper() (int, error)
- func Lgetxattr(path string, attr string) ([]byte, error)
- func Prlimit(pid, resource int, limit unix.Rlimit) error
- func RunningInUserNS() bool
- func SetKeepCaps() error
- func SetParentDeathSignal(sig uintptr) error
- func SetSubreaper(i int) error
- func Setctty() error
- func Setgid(gid int) (err error)
- func Setuid(uid int) (err error)
- func UIDMapInUserNS(uidmap []user.IDMap) bool
- type ParentDeathSignal
- func GetParentDeathSignal() (ParentDeathSignal, error)
- func (p ParentDeathSignal) Restore() error
- func (p ParentDeathSignal) Set() error
- type Stat_t
- type State
Constants ¶
const PR_SET_CHILD_SUBREAPER = 36
If arg2 is nonzero, set the "child subreaper" attribute of the calling process; if arg2 is zero, unset the attribute. When a process is marked as a child subreaper, all of the children that it creates, and their descendants, will be marked as having a subreaper. In effect, a subreaper fulfills the role of init(1) for its descendant processes. Upon termination of a process that is orphaned (i.e., its immediate parent has already terminated) and marked as having a subreaper, the nearest still living ancestor subreaper will receive a SIGCHLD signal and be able to wait(2) on the process to discover its termination status.
Functions ¶
func ClearKeepCaps ¶
func ClearKeepCaps() error
func Execv ¶
func GetClockTicks ¶
func GetClockTicks() int
func GetParentNSeuid ¶
func GetParentNSeuid() int64
GetParentNSeuid returns the euid within the parent user namespace
func GetProcessStartTime ¶
GetProcessStartTime is deprecated. Use Stat(pid) and Stat_t.StartTime instead.
func GetSubreaper ¶
GetSubreaper returns the subreaper setting for the calling process
func Lgetxattr ¶
Returns a []byte slice if the xattr is set and nil otherwise Requires path and its attribute as arguments
func Prlimit ¶
func RunningInUserNS ¶
func RunningInUserNS() bool
RunningInUserNS detects whether we are currently running in a user namespace. Originally copied from github.com/lxc/lxd/shared/util.go
func SetKeepCaps ¶
func SetKeepCaps() error
func SetParentDeathSignal ¶
func SetSubreaper ¶
SetSubreaper sets the value i as the subreaper setting for the calling process
func Setctty ¶
func Setctty() error
func Setgid ¶
Setgid sets the gid of the calling thread to the specified gid.
func Setuid ¶
Setuid sets the uid of the calling thread to the specified uid.
func UIDMapInUserNS ¶
Types ¶
type ParentDeathSignal ¶
type ParentDeathSignal int
func GetParentDeathSignal ¶
func GetParentDeathSignal() (ParentDeathSignal, error)
func (ParentDeathSignal) Restore ¶
func (p ParentDeathSignal) Restore() error
func (ParentDeathSignal) Set ¶
func (p ParentDeathSignal) Set() error
type Stat_t ¶
type Stat_t struct { // PID is the process ID. PID uint // Name is the command run by the process. Name string // State is the state of the process. State State // StartTime is the number of clock ticks after system boot (since // Linux 2.6). StartTime uint64 }
Stat_t represents the information from /proc/[pid]/stat, as described in proc(5) with names based on the /proc/[pid]/status fields.
func Stat ¶
Stat returns a Stat_t instance for the specified process.
type State ¶
type State rune
State is the status of a process.
const ( Dead State = 'X' DiskSleep State = 'D' Running State = 'R' Sleeping State = 'S' Stopped State = 'T' TracingStop State = 't' Zombie State = 'Z' )
func (State) String ¶
String forms of the state from proc(5)'s documentation for /proc/[pid]/status' "State" field.
Source Files ¶
linux.go proc.go syscall_linux_64.go sysconfig.go xattrs_linux.go
- Version
- v1.0.0-rc10
- Published
- Jan 22, 2020
- Platform
- linux/amd64
- Imports
- 12 packages
- Last checked
- 47 minutes ago –
Tools for package owners.