system

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2014 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSupportedPlatform = errors.New("platform and architecture is not supported")
)

Functions

func Chdir

func Chdir(dir string) error

func Chroot

func Chroot(dir string) error

func ClearKeepCaps added in v0.12.0

func ClearKeepCaps() error

func Clone

func Clone(flags uintptr) (int, error)

func CloseFdsFrom added in v0.11.0

func CloseFdsFrom(minFd int) error

Works similarly to OpenBSD's "closefrom(2)":

The closefrom() call deletes all descriptors numbered fd and higher from
the per-process file descriptor table.  It is effectively the same as
calling close(2) on each descriptor.

http://www.openbsd.org/cgi-bin/man.cgi?query=closefrom&sektion=2

See also http://stackoverflow.com/a/918469/433558

func Closefd

func Closefd(fd uintptr) error

func CreateMasterAndConsole

func CreateMasterAndConsole() (*os.File, string, error)

CreateMasterAndConsole will open /dev/ptmx on the host and retreive the pts name for use as the pty slave inside the container

func Dup2

func Dup2(fd1, fd2 uintptr) error

func Exec

func Exec(cmd string, args []string, env []string) error

func Execv

func Execv(cmd string, args []string, env []string) error

func Fork

func Fork() (int, error)

func GetClockTicks added in v0.11.0

func GetClockTicks() int

func GetLastAccess

func GetLastAccess(stat *syscall.Stat_t) syscall.Timespec

func GetLastModification

func GetLastModification(stat *syscall.Stat_t) syscall.Timespec

func GetParentDeathSignal added in v0.12.0

func GetParentDeathSignal() (int, error)

func GetProcessStartTime added in v0.10.0

func GetProcessStartTime(pid int) (string, error)

look in /proc to find the process start time so that we can verify that this pid has started after ourself

func Gettid added in v0.10.0

func Gettid() int

func Ioctl

func Ioctl(fd uintptr, flag, data uintptr) error

func LUtimesNano

func LUtimesNano(path string, ts []syscall.Timespec) error

func Lgetxattr

func Lgetxattr(path string, attr string) ([]byte, error)

Returns a nil slice and nil error if the xattr is not set

func Lsetxattr

func Lsetxattr(path string, attr string, data []byte, flags int) error

func Mkfifo

func Mkfifo(name string, mode uint32) error

func Mknod

func Mknod(path string, mode uint32, dev int) error

func Mount

func Mount(source, target, fstype string, flags uintptr, data string) error

func OpenPtmx

func OpenPtmx() (*os.File, error)

OpenPtmx opens /dev/ptmx, i.e. the PTY master.

func OpenTerminal

func OpenTerminal(name string, flag int) (*os.File, error)

OpenTerminal is a clone of os.OpenFile without the O_CLOEXEC used to open the pty slave inside the container namespace

func ParentDeathSignal

func ParentDeathSignal(sig uintptr) error

func Pivotroot

func Pivotroot(newroot, putold string) error

func Prctl added in v1.0.1

func Prctl(option int, arg2, arg3, arg4, arg5 uintptr) error

func Ptsname

func Ptsname(f *os.File) (string, error)

Ptsname retrieves the name of the first available pts for the given master.

func SetCloneFlags

func SetCloneFlags(cmd *exec.Cmd, flag uintptr)

func SetKeepCaps added in v0.12.0

func SetKeepCaps() error

func Setctty

func Setctty() error

func Setgid

func Setgid(gid int) error

func Setgroups

func Setgroups(gids []int) error

func Sethostname

func Sethostname(name string) error

func Setns

func Setns(fd uintptr, flags uintptr) error

func Setresgid

func Setresgid(rgid, egid, sgid int) error

func Setresuid

func Setresuid(ruid, euid, suid int) error

func Setsid

func Setsid() (int, error)

func Setuid

func Setuid(uid int) error

func Umask

func Umask(mask int) int

func Unlockpt

func Unlockpt(f *os.File) error

Unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f. Unlockpt should be called before opening the slave side of a pseudoterminal.

func Unmount

func Unmount(target string, flags int) error

func Unshare

func Unshare(flags int) error

func UsetCloseOnExec

func UsetCloseOnExec(fd uintptr) error

func UtimesNano

func UtimesNano(path string, ts []syscall.Timespec) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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