OpenBSD manual page server

Manual Page Search Parameters


pinsyscallspin system call entry to precise locations in the address space

#include <sys/types.h>

pinsyscalls(void *start, size_t len, u_int *pintable, int npins);

The () system call specifies the start to start + len address space range where the system call entry instructions are found, and a npins-sized array of u_int entries (indexed by the system call number) which are offsets from the start.

This provides the precise location for the system call instruction required for each system call number. Attempting to use a different system call entry instruction to perform a non-corresponding system call operation will fail with signal SIGABRT.

() is only called by the shared library linker to tell the kernel where the text / executable region containing system calls is found in the dynamic library (the filename is actually /usr/lib/

A similar setup operation is done automatically by the kernel for the system calls found in and in static executables.

Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

pinsyscalls() will fail if:

Implausible number of system calls provided.
Insufficient memory to service the request.
A static binary tried to call pinsyscalls(), or it was called a second time.
At least one system call offset is beyond the bounds of len.

The pinsyscalls() system call first appeared in OpenBSD 7.5.

April 1, 2024 OpenBSD-current