go/src/runtime/os_linux.go

const sigPerThreadSyscall

type mOS

//go:noescape
func futex(addr unsafe.Pointer, op int32, val uint32, ts, addr2 unsafe.Pointer, val3 uint32) int32

const _FUTEX_PRIVATE_FLAG

const _FUTEX_WAIT_PRIVATE

const _FUTEX_WAKE_PRIVATE

// Atomically,
//
//	if(*addr == val) sleep
//
// Might be woken up spuriously; that's allowed.
// Don't sleep longer than ns; ns < 0 means forever.
//
//go:nosplit
func futexsleep(addr *uint32, val uint32, ns int64) {}

// If any procs are sleeping on addr, wake up at most cnt.
//
//go:nosplit
func futexwakeup(addr *uint32, cnt uint32) {}

func getproccount() int32 {}

const _CLONE_VM

const _CLONE_FS

const _CLONE_FILES

const _CLONE_SIGHAND

const _CLONE_PTRACE

const _CLONE_VFORK

const _CLONE_PARENT

const _CLONE_THREAD

const _CLONE_NEWNS

const _CLONE_SYSVSEM

const _CLONE_SETTLS

const _CLONE_PARENT_SETTID

const _CLONE_CHILD_CLEARTID

const _CLONE_UNTRACED

const _CLONE_CHILD_SETTID

const _CLONE_STOPPED

const _CLONE_NEWUTS

const _CLONE_NEWIPC

const cloneFlags

//go:noescape
func clone(flags int32, stk, mp, gp, fn unsafe.Pointer) int32

// May run with m.p==nil, so write barriers are not allowed.
//
//go:nowritebarrier
func newosproc(mp *m) {}

// Version of newosproc that doesn't require a valid G.
//
//go:nosplit
func newosproc0(stacksize uintptr, fn unsafe.Pointer) {}

const _AT_NULL

const _AT_PAGESZ

const _AT_PLATFORM

const _AT_HWCAP

const _AT_SECURE

const _AT_RANDOM

const _AT_HWCAP2

var procAuxv

var addrspace_vec

func mincore(addr unsafe.Pointer, n uintptr, dst *byte) int32

var auxvreadbuf

func sysargs(argc int32, argv **byte) {}

var secureMode

func sysauxv(auxv []uintptr) (pairs int) {}

var sysTHPSizePath

func getHugePageSize() uintptr {}

func osinit() {}

var urandom_dev

func readRandom(r []byte) int {}

func goenvs() {}

// Called to do synchronous initialization of Go code built with
// -buildmode=c-archive or -buildmode=c-shared.
// None of the Go runtime is initialized.
//
//go:nosplit
//go:nowritebarrierrec
func libpreinit() {}

// Called to initialize a new m (including the bootstrap m).
// Called on the parent thread (main thread in case of bootstrap), can allocate memory.
func mpreinit(mp *m) {}

func gettid() uint32

// Called to initialize a new m (including the bootstrap m).
// Called on the new thread, cannot allocate memory.
func minit() {}

// Called from dropm to undo the effect of an minit.
//
//go:nosplit
func unminit() {}

// Called from exitm, but not from drop, to undo the effect of thread-owned
// resources in minit, semacreate, or elsewhere. Do not take locks after calling this.
func mdestroy(mp *m) {}

func sigreturn__sigaction()

func sigtramp()

func cgoSigtramp()

//go:noescape
func sigaltstack(new, old *stackt)

//go:noescape
func setitimer(mode int32, new, old *itimerval)

//go:noescape
func timer_create(clockid int32, sevp *sigevent, timerid *int32) int32

//go:noescape
func timer_settime(timerid int32, flags int32, new, old *itimerspec) int32

//go:noescape
func timer_delete(timerid int32) int32

//go:noescape
func rtsigprocmask(how int32, new, old *sigset, size int32)

//go:nosplit
//go:nowritebarrierrec
func sigprocmask(how int32, new, old *sigset) {}

func raise(sig uint32)

func raiseproc(sig uint32)

//go:noescape
func sched_getaffinity(pid, len uintptr, buf *byte) int32

func osyield()

//go:nosplit
func osyield_no_g() {}

func pipe2(flags int32) (r, w int32, errno int32)

//go:nosplit
func fcntl(fd, cmd, arg int32) (ret int32, errno int32) {}

const _si_max_size

const _sigev_max_size

//go:nosplit
//go:nowritebarrierrec
func setsig(i uint32, fn uintptr) {}

//go:nosplit
//go:nowritebarrierrec
func setsigstack(i uint32) {}

//go:nosplit
//go:nowritebarrierrec
func getsig(i uint32) uintptr {}

// setSignalstackSP sets the ss_sp field of a stackt.
//
//go:nosplit
func setSignalstackSP(s *stackt, sp uintptr) {}

//go:nosplit
func (c *sigctxt) fixsigcode(sig uint32) {}

// sysSigaction calls the rt_sigaction system call.
//
//go:nosplit
func sysSigaction(sig uint32, new, old *sigactiont) {}

// rt_sigaction is implemented in assembly.
//
//go:noescape
func rt_sigaction(sig uintptr, new, old *sigactiont, size uintptr) int32

func getpid() int

func tgkill(tgid, tid, sig int)

// signalM sends a signal to mp.
func signalM(mp *m, sig int) {}

// validSIGPROF compares this signal delivery's code against the signal sources
// that the profiler uses, returning whether the delivery should be processed.
// To be processed, a signal delivery from a known profiling mechanism should
// correspond to the best profiling mechanism available to this thread. Signals
// from other sources are always considered valid.
//
//go:nosplit
func validSIGPROF(mp *m, c *sigctxt) bool {}

func setProcessCPUProfiler(hz int32) {}

func setThreadCPUProfiler(hz int32) {}

type perThreadSyscallArgs

var perThreadSyscall

// syscall_runtime_doAllThreadsSyscall and executes a specified system call on
// all Ms.
//
// The system call is expected to succeed and return the same value on every
// thread. If any threads do not match, the runtime throws.
//
//go:linkname syscall_runtime_doAllThreadsSyscall syscall.runtime_doAllThreadsSyscall
//go:uintptrescapes
func syscall_runtime_doAllThreadsSyscall(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {}

// runPerThreadSyscall runs perThreadSyscall for this M if required.
//
// This function throws if the system call returns with anything other than the
// expected values.
//
//go:nosplit
func runPerThreadSyscall() {}

const _SI_USER

const _SI_TKILL

const _SYS_SECCOMP

// sigFromUser reports whether the signal was sent because of a call
// to kill or tgkill.
//
//go:nosplit
func (c *sigctxt) sigFromUser() bool {}

// sigFromSeccomp reports whether the signal was sent from seccomp.
//
//go:nosplit
func (c *sigctxt) sigFromSeccomp() bool {}

//go:nosplit
func mprotect(addr unsafe.Pointer, n uintptr, prot int32) (ret int32, errno int32) {}