kern_syscall_deregister: document syscall 0 no-op logic

Document syscall #0 being handled specially in
`kern_syscall_deregister(..)`: it's a reserved syscall and not
dynamically registered, and hence does not need to be deregistered in
the function.

Co-authored-by:	ngie@
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D54326
This commit is contained in:
Anagh Verma 2026-01-05 23:42:56 -08:00 committed by Enji Cooper
parent 4028504b48
commit f384784289

View file

@ -161,8 +161,14 @@ kern_syscall_deregister(struct sysent *sysents, int offset,
{
struct sysent *se;
if (offset == 0)
return (0); /* XXX? */
if (offset == 0) {
/*
* Syscall #0 is reserved and is not dynamically registered.
* Treat deregistration as a no-op to simplify module unload
* paths.
*/
return (0);
}
se = &sysents[offset];
if ((se->sy_thrcnt & SY_THR_STATIC) != 0)