man.bsd.lv manual page server

Manual Page Search Parameters

CURPROC(9) Kernel Developer's Manual CURPROC(9)

curproc, curcpu, curlwpcurrent process, processor, and LWP

#include <sys/proc.h>

struct cpu_info *
curcpu(void);

struct proc *
curproc(void);

struct lwp *
curlwp(void);

The following macros can be used to retrieve the current processor, process, and light-weight process (LWP), respectively:
  1. The machine-dependent () macro returns a pointer to a structure containing information of the CPU that this thread is running on.
  2. The machine-independent () macro refers to a pointer to the process currently running on this CPU.
  3. The () macro expands to a pointer to structure, containing information about the current LWP. This macro is machine-independent, but machine-dependent <machine/cpu.h> may redefine it.

cpu_number(9), proc_find(9)

July 1, 2010 NetBSD-9.2