Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
SYSCALL_HELPER_REGIST... BSD Kernel Developer's	ManualSYSCALL_HELPER_REGIST...

NAME
     syscall_helper_register, syscall_helper_unregister	-- kernel syscall reg-
     istration 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
     The syscall_helper_register() registers a system call.  This function
     takes the structure struct	syscall_helper_data sd,	which specifies	the
     parameters	for syscall registration:

	   struct syscall_helper_data {
		   struct sysent   new_sysent;
		   struct sysent   old_sysent;
		   int		   syscall_no;
		   int		   registered;
	   };

     The only valid flag for the flags argument	to syscall_helper_register()
     is	SY_THR_STATIC.	This flag prevents the syscall from being unregis-
     tered.

     Before use, the structure must be initialized with	one of the
     SYSCALL_INIT_HELPER*() macros.  In	new code, syscall implementation func-
     tions 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 previ-
     ously 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]		The flags argument contained a value other than
			SY_THR_STATIC.

     [EINVAL]		The specified syscall number, sd.syscall_no
			(SYS_syscallname), was outside of the valid range of
			system call numbers (zero through SYS_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
     SYSCALL_MODULE(9)

BSD			       February	10, 2018			   BSD

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ERRORS | SEE ALSO

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=syscall_helper_register&sektion=9&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help