⬢ DragonFlyBSD Kernel Audit
DF-5703 / kernel_strtol_shim.h
← back to finding ↓ download raw
/* Kernel-source shims: replace <sys/param.h> <sys/systm.h> <sys/ctype.h>
 * <machine/limits.h> so the untouched kernel parser body compiles userland.
 * Kernel ctype macros (sys/sys/ctype.h:43-51) are byte-identical in
 * semantics to userland C-locale ctype(3) for all 256 byte values.
 * LONG_MAX/LONG_MIN/ULONG_MAX come from userland <limits.h> (via
 * <sys/limits.h>) and match machine/limits.h on the same machine word. */
#ifndef KERNEL_STRTOL_SHIM_H
#define KERNEL_STRTOL_SHIM_H
#include <sys/types.h>		/* u_long (strtol.c:52/54 uses plain unsigned long) */
#include <ctype.h>		/* isspace isdigit isalpha isupper isxdigit isascii */
#include <stddef.h>		/* NULL (kernel gets it from <sys/systm.h>) */
#include <limits.h>		/* LONG_MAX LONG_MIN ULONG_MAX */
#endif