syscalls

package
v0.0.0-...-23e6066 Latest Latest
Warning

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

Go to latest
Published: May 3, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package syscalls is the interface from the application to the kernel. Traditionally, syscalls is the interface that is used by applications to request services from the kernel of a operating system. We provide a user-mode kernel that needs to handle those requests coming from unmodified applications. Therefore, we still use the term "syscalls" to denote this interface.

Note that the stubs in this package may merely provide the interface, not the actual implementation. It just makes writing syscall stubs straightforward.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEpoll

func AddEpoll(t *kernel.Task, epfd kdefs.FD, fd kdefs.FD, flags epoll.EntryFlags, mask waiter.EventMask, userData [2]int32) error

AddEpoll implements the epoll_ctl(2) linux syscall when op is EPOLL_CTL_ADD.

func CapError

func CapError(c linux.Capability) kernel.SyscallFn

CapError gives a syscall function that checks for capability c. If the task has the capability, it returns ENOSYS, otherwise EPERM. To unprivileged tasks, it will seem like there is an implementation.

func CreateEpoll

func CreateEpoll(t *kernel.Task, closeOnExec bool) (kdefs.FD, error)

CreateEpoll implements the epoll_create(2) linux syscall.

func Error

func Error(err error) kernel.SyscallFn

Error returns a syscall handler that will always give the passed error.

func ErrorWithEvent

func ErrorWithEvent(err error) kernel.SyscallFn

ErrorWithEvent gives a syscall function that sends an unimplemented syscall event via the event channel and returns the passed error.

func Poll

func Poll(t *kernel.Task, pfd []PollFD, timeout time.Duration) (time.Duration, uintptr, error)

Poll polls the PollFDs in "pfd" with a bounded time specified in "timeout" when "timeout" is greater than zero.

Poll returns the remaining timeout, which is always 0 on a timeout; and 0 or positive if interrupted by a signal.

func RemoveEpoll

func RemoveEpoll(t *kernel.Task, epfd kdefs.FD, fd kdefs.FD) error

RemoveEpoll implements the epoll_ctl(2) linux syscall when op is EPOLL_CTL_DEL.

func UnimplementedEvent

func UnimplementedEvent(t *kernel.Task)

UnimplementedEvent emits an UnimplementedSyscall event via the event channel.

func UpdateEpoll

func UpdateEpoll(t *kernel.Task, epfd kdefs.FD, fd kdefs.FD, flags epoll.EntryFlags, mask waiter.EventMask, userData [2]int32) error

UpdateEpoll implements the epoll_ctl(2) linux syscall when op is EPOLL_CTL_MOD.

func WaitEpoll

func WaitEpoll(t *kernel.Task, fd kdefs.FD, max int, timeout int) ([]epoll.Event, error)

WaitEpoll implements the epoll_wait(2) linux syscall.

Types

type PollFD

type PollFD struct {
	FD      kdefs.FD
	Events  waiter.EventMask
	REvents waiter.EventMask
}

PollFD describes a pollable FD.

Directories

Path Synopsis
Package linux provides syscall tables for amd64 Linux.
Package linux provides syscall tables for amd64 Linux.

Jump to

Keyboard shortcuts

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