linux

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2017 License: MIT Imports: 17 Imported by: 6

Documentation

Index

Constants

View Source
const (
	DT_UNKNOWN = 0
	DT_FIFO    = 1
	DT_CHR     = 2
	DT_DIR     = 4
	DT_BLK     = 6
	DT_REG     = 8
	DT_LNK     = 10
	DT_SOCK    = 12
	DT_WHT     = 14
)
View Source
const (
	ELF_AT_NULL = iota
	ELF_AT_IGNORE
	ELF_AT_EXECFD
	ELF_AT_PHDR
	ELF_AT_PHENT
	ELF_AT_PHNUM
	ELF_AT_PAGESZ
	ELF_AT_BASE
	ELF_AT_FLAGS
	ELF_AT_ENTRY
	ELF_AT_NOTELF
	ELF_AT_UID
	ELF_AT_EUID
	ELF_AT_GID
	ELF_AT_EGID
	ELF_AT_PLATFORM
	ELF_AT_HWCAP
	ELF_AT_CLKTCK       = 17
	ELF_AT_RANDOM       = 25
	ELF_AT_SYSINFO      = 32
	ELF_AT_SYSINFO_EHDR = 33
)
View Source
const UINT64_MAX = 0xFFFFFFFFFFFFFFFF

Variables

This section is empty.

Functions

func Pack

func Pack(buf co.Buf, i interface{}) error

func SetupElfAuxv

func SetupElfAuxv(u models.Usercorn) ([]byte, error)

func StackInit

func StackInit(u models.Usercorn, args, env []string) error

func Unpack

func Unpack(k *LinuxKernel, arg interface{}, vals []interface{}) error

Types

type Dirent

type Dirent struct {
	Ino  uint64 `struc:"uint64"`
	Off  uint64 `struc:"uint64"`
	Len  int    `struc:"uint16"`
	Name string
	Type int `struc:"uint8"`
}

TODO: need to differentiate between guests with and without LFS

type Dirent64

type Dirent64 struct {
	Ino  uint64 `struc:"uint64"`
	Off  uint64 `struc:"uint64"`
	Len  int    `struc:"uint16"`
	Type int    `struc:"uint8"`
	Name string
}

type ElfAuxv

type ElfAuxv struct {
	Type, Val uint64 `struc:"size_t"`
}

type LinuxKernel

type LinuxKernel struct {
	posix.PosixKernel
}

func NewKernel

func NewKernel() *LinuxKernel

func (*LinuxKernel) Fadvise64

func (k *LinuxKernel) Fadvise64()

func (*LinuxKernel) Fstat64

func (k *LinuxKernel) Fstat64(fd co.Fd, buf co.Obuf) uint64

func (*LinuxKernel) Futex

func (k *LinuxKernel) Futex(uaddr co.Buf, op, val int, timeout, uaddr2 co.Buf, val3 int)

timeout is a co.Buf here because some forms of futex don't pass it

func (*LinuxKernel) Getdents

func (k *LinuxKernel) Getdents(dirfd co.Fd, buf co.Obuf, count uint64) uint64

func (*LinuxKernel) Getdents64

func (k *LinuxKernel) Getdents64(dirfd co.Fd, buf co.Obuf, count uint64) uint64

func (*LinuxKernel) Geteuid32

func (k *LinuxKernel) Geteuid32() int

func (*LinuxKernel) Getgid32

func (k *LinuxKernel) Getgid32() int

func (*LinuxKernel) Gettimeofday

func (k *LinuxKernel) Gettimeofday(tp co.Obuf, tz *native.Timespec) uint64

func (*LinuxKernel) Getuid32

func (k *LinuxKernel) Getuid32() int

func (*LinuxKernel) Lstat64

func (k *LinuxKernel) Lstat64(path string, buf co.Obuf) uint64

func (*LinuxKernel) Select

func (k *LinuxKernel) Select(args []co.Obuf, nfds int, readfds, writefds, errorfds *native.Fdset32, timeout *syscall.Timeval) uint64

func (*LinuxKernel) Sendfile

func (k *LinuxKernel) Sendfile(out, in co.Fd, off co.Buf, count uint64) uint64

func (*LinuxKernel) Setgid32

func (k *LinuxKernel) Setgid32(gid int32) int

func (*LinuxKernel) Setuid32

func (k *LinuxKernel) Setuid32(uid int32) int

func (*LinuxKernel) Stat64

func (k *LinuxKernel) Stat64() int

func (*LinuxKernel) Uname

func (k *LinuxKernel) Uname(buf co.Buf)

func (*LinuxKernel) Utimensat

func (k *LinuxKernel) Utimensat()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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