Documentation ¶
Index ¶
- Variables
- func KillableWait(cond *sync.Cond) defs.Err_t
- func Oom_init(evict func() (int, int))
- func Proc_del(pid int)
- func Tid_del()
- type Cons_i
- type Proc_t
- func (p *Proc_t) Doomall()
- func (p *Proc_t) Doomed() bool
- func (p *Proc_t) Fd_del(fdn int) (*fd.Fd_t, bool)
- func (p *Proc_t) Fd_dup(ofdn, nfdn int) (*fd.Fd_t, bool, defs.Err_t)
- func (p *Proc_t) Fd_get(fdn int) (*fd.Fd_t, bool)
- func (p *Proc_t) Fd_get_inner(fdn int) (*fd.Fd_t, bool)
- func (p *Proc_t) Fd_insert(f *fd.Fd_t, perms int) (int, bool)
- func (p *Proc_t) Fd_insert2(f1 *fd.Fd_t, perms1 int, f2 *fd.Fd_t, perms2 int) (int, int, bool)
- func (p *Proc_t) Reap_doomed(tid defs.Tid_t)
- func (p *Proc_t) Sched_add(tf *[defs.TFSIZE]uintptr, tid defs.Tid_t)
- func (p *Proc_t) Start_proc(pid int) bool
- func (p *Proc_t) Start_thread(t defs.Tid_t) bool
- func (p *Proc_t) Thread_count() int
- func (p *Proc_t) Thread_dead(tid defs.Tid_t, status int, usestatus bool)
- func (p *Proc_t) Thread_new() (defs.Tid_t, bool)
- func (p *Proc_t) Thread_undo(t defs.Tid_t)
- func (p *Proc_t) Tid0() defs.Tid_t
- func (p *Proc_t) Tlbflush()
- func (p *Proc_t) Userargs(uva int) ([]ustr.Ustr, defs.Err_t)
- func (parent *Proc_t) Vm_fork(child *Proc_t, rsp uintptr) (bool, bool)
- type Syscall_i
- type Ulimit_t
- type Wait_t
- type Waitst_t
Constants ¶
This section is empty.
Variables ¶
var Oom *oom_t = &oom_t{halp: oommsg.OomCh}
var Ptable = ptable_t{ // contains filtered or unexported fields }
Functions ¶
func KillableWait ¶
returns non-zero if this calling process has been killed and the caller should finish the system call.
Types ¶
type Proc_t ¶
type Proc_t struct { Pid int Name ustr.Ustr // waitinfo for my child processes Mywait Wait_t // waitinfo of my parent Pwait *Wait_t // thread tids of this process Threadi tinfo.Threadinfo_t // Address space Vm vm.Vm_t // mmap next virtual address hint Mmapi int Fds []*fd.Fd_t // fds, fdstart, nfds protected by fdl Fdl sync.Mutex Cwd *fd.Cwd_t Ulim Ulimit_t // this proc's rusage Atime accnt.Accnt_t // total child rusage Catime accnt.Accnt_t // no thread can read/write Oomlink except the OOM killer Oomlink *Proc_t // contains filtered or unexported fields }
func CurrentProc ¶
func CurrentProc() *Proc_t
func Proc_check ¶
func Proc_new ¶
returns the new proc and success; can fail if the system-wide limit of procs/threads has been reached. the parent's fdtable must be locked.
func (*Proc_t) Fd_dup ¶
fdn is not guaranteed to be a sane fd. returns the the fd replaced by ofdn and whether it exists and needs to be closed, and success.
func (*Proc_t) Fd_get_inner ¶
fdn is not guaranteed to be a sane fd
func (*Proc_t) Fd_insert ¶
an fd table invariant: every fd must have its file field set. thus the caller cannot set an fd's file field without holding fdl. otherwise you will race with a forking thread when it copies the fd table.
func (*Proc_t) Fd_insert2 ¶
returns the fd numbers and success
func (*Proc_t) Reap_doomed ¶
func (*Proc_t) Start_proc ¶
returns false if the number of running threads or unreaped child statuses is larger than noproc.
func (*Proc_t) Start_thread ¶
returns false if the number of running threads or unreaped child statuses is larger than noproc.
func (*Proc_t) Thread_count ¶
func (*Proc_t) Thread_dead ¶
terminate a single thread
func (*Proc_t) Thread_undo ¶
undo thread_new(); sched_add() must not have been called on t.
type Syscall_i ¶
type Syscall_i interface { Syscall(p *Proc_t, tid defs.Tid_t, tf *[defs.TFSIZE]uintptr) int Sys_close(proc *Proc_t, fdn int) int Sys_exit(Proc *Proc_t, tid defs.Tid_t, status int) }
XXX add all syscalls so that we easily can do syscall interposition. currently no use.
type Waitst_t ¶
type Waitst_t struct { Pid int Status int Atime accnt.Accnt_t // true iff the exit status is valid Valid bool }
requirements for wait* syscalls (used for processes and threads): - wait for a pid that is not my child must fail - only one wait for a specific pid may succeed; others must fail - wait when there are no children must fail - wait for a process should not return thread info and vice versa