SYSCALL_HELPER_UNREGISTER(9)
π SYSCALL_HELPER_REGISTER(9) π
okay bestie, this is the Kernel Developer's Manual page for the syscall helper registration glow-up: syscall_helper_register, syscall_helper_unregister, and the SYSCALL_INIT_HELPER* macro squad π
. no cap, every flag and error is staying right here.
β¨ NAME β¨
syscall_helper_register, syscall_helper_unregister β kernel syscall registration routines π«Ά
π¦ SYNOPSIS π¦
#include <sys/sysent.h>
int
syscall_helper_register(struct syscall_helper_data *sd, int flags);
int
syscall_helper_unregister(struct syscall_helper_data *sd);
π INITIALIZER MACROS π
struct syscall_helper_data
SYSCALL_INIT_HELPER(syscallname);
struct syscall_helper_data
SYSCALL_INIT_HELPER_F(syscallname, int flags);
πΈ COMPATIBILITY INITIALIZER MACROS πΈ
struct syscall_helper_data
SYSCALL_INIT_HELPER_COMPAT(syscallname);
struct syscall_helper_data
SYSCALL_INIT_HELPER_COMPAT_F(syscallname, int flags);
π DESCRIPTION π
syscall_helper_register() registers a system call. it takes the structure struct syscall_helper_data sd, which specifies the parameters for syscall registration β and here's the struct in all its main-character glory:
struct syscall_helper_data {
struct sysent new_sysent;
struct sysent old_sysent;
int syscall_no;
int registered;
};
the only valid flag for theflagsargument tosyscall_helper_register()isSY_THR_STATIC. this flag prevents the syscall from being unregistered. periodt.
before use, the structure must be initialized with one of the SYSCALL_INIT_HELPER*() macros. in new code, syscall implementation functions shall be named sys_syscallname() and the regular macros shall be used β¨.
for legacy syscall functions named without "sys_" prefixes, the "COMPAT" versions of the macros may be used.
the only valid flag for the flags argument to the "F" variants of the initializer macros is SYF_CAPENABLED. this flag indicates that the syscall is allowed in capability mode π¦.
the syscall_helper_unregister() unregisters a system call. this function takes the same structure struct syscall_helper_data sd that was previously initialized in the manner described above and used in a successful invocation of syscall_helper_register() π
.
π RETURN VALUES π
if successful, syscall_helper_register() and syscall_helper_unregister() will return 0. otherwise, they will return an error π.
π₯ ERRORS π₯
the syscall_helper_register() call will fail and the syscall will not be registered if:
[EINVAL]β theflagsargument contained a value other thanSY_THR_STATIC.[EINVAL]β the specified syscall number,sd.syscall_no(SYS_syscallname), was outside of the valid range of system call numbers (zero throughSYS_MAXSYSCALL).[ENFILE]β the system call table does not have any available slots.[EEXIST]β the specified syscall number,sd.syscall_no(SYS_syscallname), was already in use.
π«Ά SEE ALSO π«Ά
okay that's the whole vibe check π this page is from Debian, dated February 10, 2018 β byeee bestie, go register those syscalls responsibly ππ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2018 Conrad Meyer <cem@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms