HomeFreeBSD

MFC 309589: Rework syscall structure lookups.

Description

MFC 309589: Rework syscall structure lookups.

Avoid always using an O(n^2) loop over known syscall structures with
strcmp() on each system call. Instead, use a per-ABI cache indexed by
the system call number. The first 1024 system calls (which should cover
all of the normal system calls in currently-supported ABIs) use a flat array
indexed by the system call number to find system call structure. For other
system calls, a linked list of structures storing an integer to structure
mapping is stored in the ABI. The linked list isn't very smart, but it
should only be used by buggy applications invoking unknown system calls.

This also fixes handling of unknown system calls which currently trigger
a NULL pointer dereference.

Details

Provenance
jhbAuthored on
Parents
rS312083: Update the shm_open.2 man page to reflect objective reality.
Branches
Unknown
Tags
Unknown