Index: linux/arch/aarch64/linux_syscall.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/aarch64/linux_syscall.h,v retrieving revision 1.14 diff -u -r1.14 linux_syscall.h --- linux/arch/aarch64/linux_syscall.h 26 Oct 2025 16:25:15 -0000 1.14 +++ linux/arch/aarch64/linux_syscall.h 10 Nov 2025 14:48:04 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscall.h,v 1.14 2025/10/26 16:25:15 christos Exp $ */ +/* $NetBSD$ */ /* * System call numbers. @@ -426,6 +426,9 @@ /* syscall: "umask" ret: "int" args: "int" */ #define LINUX_SYS_umask 166 +/* syscall: "__prctl" ret: "int" args: "int" "..." */ +#define LINUX_SYS___prctl 167 + /* syscall: "getcpu" ret: "int" args: "unsigned int *" "unsigned int *" "struct linux_getcpu_cache *" */ #define LINUX_SYS_getcpu 168 Index: linux/arch/aarch64/linux_syscallargs.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/aarch64/linux_syscallargs.h,v retrieving revision 1.14 diff -u -r1.14 linux_syscallargs.h --- linux/arch/aarch64/linux_syscallargs.h 26 Oct 2025 16:25:15 -0000 1.14 +++ linux/arch/aarch64/linux_syscallargs.h 10 Nov 2025 14:48:05 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscallargs.h,v 1.14 2025/10/26 16:25:15 christos Exp $ */ +/* $NetBSD$ */ /* * System call argument lists. @@ -764,6 +764,11 @@ struct sys_umask_args; +struct linux_sys___prctl_args { + syscallarg(int) code; + syscallarg(void *) args[SYS_MAXSYSARGS]; +}; + struct linux_sys_getcpu_args { syscallarg(unsigned int *) cpu; syscallarg(unsigned int *) node; @@ -1447,6 +1452,8 @@ int sys_umask(struct lwp *, const struct sys_umask_args *, register_t *); +int linux_sys___prctl(struct lwp *, const struct linux_sys___prctl_args *, register_t *); + int linux_sys_getcpu(struct lwp *, const struct linux_sys_getcpu_args *, register_t *); int linux_sys_gettimeofday(struct lwp *, const struct linux_sys_gettimeofday_args *, register_t *); Index: linux/arch/aarch64/linux_syscalls.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/aarch64/linux_syscalls.c,v retrieving revision 1.14 diff -u -r1.14 linux_syscalls.c --- linux/arch/aarch64/linux_syscalls.c 26 Oct 2025 16:25:15 -0000 1.14 +++ linux/arch/aarch64/linux_syscalls.c 10 Nov 2025 14:48:05 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscalls.c,v 1.14 2025/10/26 16:25:15 christos Exp $ */ +/* $NetBSD$ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.14 2025/10/26 16:25:15 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -209,7 +209,7 @@ /* 164 */ "setrlimit", /* 165 */ "getrusage", /* 166 */ "umask", - /* 167 */ "#167 (unimplemented prctl)", + /* 167 */ "__prctl", /* 168 */ "getcpu", /* 169 */ "gettimeofday", /* 170 */ "settimeofday", @@ -747,7 +747,7 @@ /* 164 */ NULL, /* setrlimit */ /* 165 */ NULL, /* getrusage */ /* 166 */ NULL, /* umask */ - /* 167 */ NULL, /* unimplemented prctl */ + /* 167 */ NULL, /* __prctl */ /* 168 */ NULL, /* getcpu */ /* 169 */ NULL, /* gettimeofday */ /* 170 */ NULL, /* settimeofday */ Index: linux/arch/aarch64/linux_sysent.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/aarch64/linux_sysent.c,v retrieving revision 1.14 diff -u -r1.14 linux_sysent.c --- linux/arch/aarch64/linux_sysent.c 26 Oct 2025 16:25:15 -0000 1.14 +++ linux/arch/aarch64/linux_sysent.c 10 Nov 2025 14:48:05 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysent.c,v 1.14 2025/10/26 16:25:15 christos Exp $ */ +/* $NetBSD$ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.14 2025/10/26 16:25:15 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -771,8 +771,10 @@ .sy_call = (sy_call_t *)sys_umask }, /* 166 = umask */ { - .sy_call = linux_sys_nosys, - }, /* 167 = filler */ + ns(struct linux_sys___prctl_args), + .sy_flags = SYCALL_ARG_PTR | SYCALL_INDIRECT, + .sy_call = (sy_call_t *)linux_sys___prctl + }, /* 167 = __prctl */ { ns(struct linux_sys_getcpu_args), .sy_flags = SYCALL_ARG_PTR, Index: linux/arch/aarch64/linux_systrace_args.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/aarch64/linux_systrace_args.c,v retrieving revision 1.14 diff -u -r1.14 linux_systrace_args.c --- linux/arch/aarch64/linux_systrace_args.c 26 Oct 2025 16:25:15 -0000 1.14 +++ linux/arch/aarch64/linux_systrace_args.c 10 Nov 2025 14:48:06 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_systrace_args.c,v 1.14 2025/10/26 16:25:15 christos Exp $ */ +/* $NetBSD$ */ /* * System call argument to DTrace register array conversion. @@ -1187,6 +1187,14 @@ *n_args = 1; break; } + /* linux_sys___prctl */ + case 167: { + const struct linux_sys___prctl_args *p = params; + iarg[0] = SCARG(p, code); /* int */ + uarg[1] = (intptr_t) SCARG(p, args[0]); /* void * */ + *n_args = 2; + break; + } /* linux_sys_getcpu */ case 168: { const struct linux_sys_getcpu_args *p = params; @@ -3892,6 +3900,19 @@ break; }; break; + /* linux_sys___prctl */ + case 167: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "void *"; + break; + default: + break; + }; + break; /* linux_sys_getcpu */ case 168: switch(ndx) { @@ -5772,6 +5793,11 @@ if (ndx == 0 || ndx == 1) p = "int"; break; + /* linux_sys___prctl */ + case 167: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_sys_getcpu */ case 168: if (ndx == 0 || ndx == 1) Index: linux/arch/aarch64/syscalls.master =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/aarch64/syscalls.master,v retrieving revision 1.15 diff -u -r1.15 syscalls.master --- linux/arch/aarch64/syscalls.master 26 Oct 2025 16:19:05 -0000 1.15 +++ linux/arch/aarch64/syscalls.master 10 Nov 2025 14:48:06 -0000 @@ -347,7 +347,8 @@ 165 NOARGS { int|compat_50_sys||getrusage(int who, \ struct rusage50 *rusage); } 166 NOARGS { int|sys||umask(int newmask); } -167 UNIMPL prctl +167 INDIR { int|linux_sys||__prctl(int code, \ + ... void * args[SYS_MAXSYSARGS]); } 168 STD { int|linux_sys||getcpu(unsigned int *cpu, \ unsigned int *node, \ struct linux_getcpu_cache *tcache); } Index: linux/arch/alpha/linux_syscall.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/alpha/linux_syscall.h,v retrieving revision 1.123 diff -u -r1.123 linux_syscall.h --- linux/arch/alpha/linux_syscall.h 26 Oct 2025 16:25:15 -0000 1.123 +++ linux/arch/alpha/linux_syscall.h 10 Nov 2025 14:48:06 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscall.h,v 1.123 2025/10/26 16:25:15 christos Exp $ */ +/* $NetBSD$ */ /* * System call numbers. @@ -504,6 +504,9 @@ /* syscall: "getresuid" ret: "int" args: "uid_t *" "uid_t *" "uid_t *" */ #define LINUX_SYS_getresuid 344 +/* syscall: "__prctl" ret: "int" args: "int" "..." */ +#define LINUX_SYS___prctl 348 + /* syscall: "pread" ret: "int" args: "int" "char *" "size_t" "off_t" */ #define LINUX_SYS_pread 349 Index: linux/arch/alpha/linux_syscallargs.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/alpha/linux_syscallargs.h,v retrieving revision 1.122 diff -u -r1.122 linux_syscallargs.h --- linux/arch/alpha/linux_syscallargs.h 26 Oct 2025 16:25:15 -0000 1.122 +++ linux/arch/alpha/linux_syscallargs.h 10 Nov 2025 14:48:06 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscallargs.h,v 1.122 2025/10/26 16:25:15 christos Exp $ */ +/* $NetBSD$ */ /* * System call argument lists. @@ -707,6 +707,11 @@ }; check_syscall_args(linux_sys_getresuid) +struct linux_sys___prctl_args { + syscallarg(int) code; + syscallarg(void *) args[SYS_MAXSYSARGS]; +}; + struct linux_sys_pread_args { syscallarg(int) fd; syscallarg(char *) buf; @@ -1771,6 +1776,8 @@ int linux_sys_getresuid(struct lwp *, const struct linux_sys_getresuid_args *, register_t *); +int linux_sys___prctl(struct lwp *, const struct linux_sys___prctl_args *, register_t *); + int linux_sys_pread(struct lwp *, const struct linux_sys_pread_args *, register_t *); int linux_sys_pwrite(struct lwp *, const struct linux_sys_pwrite_args *, register_t *); Index: linux/arch/alpha/linux_syscalls.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/alpha/linux_syscalls.c,v retrieving revision 1.124 diff -u -r1.124 linux_syscalls.c --- linux/arch/alpha/linux_syscalls.c 26 Oct 2025 16:25:15 -0000 1.124 +++ linux/arch/alpha/linux_syscalls.c 10 Nov 2025 14:48:06 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscalls.c,v 1.124 2025/10/26 16:25:15 christos Exp $ */ +/* $NetBSD$ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.124 2025/10/26 16:25:15 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -410,7 +410,7 @@ /* 345 */ "#345 (unimplemented pciconfig_read)", /* 346 */ "#346 (unimplemented pciconfig_write)", /* 347 */ "#347 (unimplemented query_module)", - /* 348 */ "#348 (unimplemented prctl)", + /* 348 */ "__prctl", /* 349 */ "pread", /* 350 */ "pwrite", /* 351 */ "rt_sigreturn", @@ -1463,7 +1463,7 @@ /* 345 */ NULL, /* unimplemented pciconfig_read */ /* 346 */ NULL, /* unimplemented pciconfig_write */ /* 347 */ NULL, /* unimplemented query_module */ - /* 348 */ NULL, /* unimplemented prctl */ + /* 348 */ NULL, /* __prctl */ /* 349 */ NULL, /* pread */ /* 350 */ NULL, /* pwrite */ /* 351 */ NULL, /* rt_sigreturn */ Index: linux/arch/alpha/linux_sysent.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/alpha/linux_sysent.c,v retrieving revision 1.123 diff -u -r1.123 linux_sysent.c --- linux/arch/alpha/linux_sysent.c 26 Oct 2025 16:25:16 -0000 1.123 +++ linux/arch/alpha/linux_sysent.c 10 Nov 2025 14:48:07 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysent.c,v 1.123 2025/10/26 16:25:16 christos Exp $ */ +/* $NetBSD$ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.123 2025/10/26 16:25:16 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -1384,8 +1384,10 @@ .sy_call = linux_sys_nosys, }, /* 347 = filler */ { - .sy_call = linux_sys_nosys, - }, /* 348 = filler */ + ns(struct linux_sys___prctl_args), + .sy_flags = SYCALL_ARG_PTR | SYCALL_INDIRECT, + .sy_call = (sy_call_t *)linux_sys___prctl + }, /* 348 = __prctl */ { ns(struct linux_sys_pread_args), .sy_flags = SYCALL_NARGS64_VAL(1) | SYCALL_ARG3_64 | SYCALL_ARG_PTR, Index: linux/arch/alpha/syscalls.master =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/alpha/syscalls.master,v retrieving revision 1.110 diff -u -r1.110 syscalls.master --- linux/arch/alpha/syscalls.master 26 Oct 2025 16:19:05 -0000 1.110 +++ linux/arch/alpha/syscalls.master 10 Nov 2025 14:48:07 -0000 @@ -558,7 +558,8 @@ 345 UNIMPL pciconfig_read 346 UNIMPL pciconfig_write 347 UNIMPL query_module -348 UNIMPL prctl +348 INDIR { int|linux_sys||__prctl(int code, \ + ... void * args[SYS_MAXSYSARGS]); } 349 STD { int|linux_sys||pread(int fd, char *buf, \ size_t nbyte, off_t offset); } 350 STD { int|linux_sys||pwrite(int fd, char *buf, \ Index: linux/arch/amd64/linux_syscall.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/amd64/linux_syscall.h,v retrieving revision 1.85 diff -u -r1.85 linux_syscall.h --- linux/arch/amd64/linux_syscall.h 26 Oct 2025 16:25:16 -0000 1.85 +++ linux/arch/amd64/linux_syscall.h 10 Nov 2025 14:48:07 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscall.h,v 1.85 2025/10/26 16:25:16 christos Exp $ */ +/* $NetBSD$ */ /* * System call numbers. @@ -471,6 +471,9 @@ /* syscall: "__sysctl" ret: "int" args: "struct linux___sysctl *" */ #define LINUX_SYS___sysctl 156 +/* syscall: "__prctl" ret: "int" args: "int" "..." */ +#define LINUX_SYS___prctl 157 + /* syscall: "arch_prctl" ret: "int" args: "int" "unsigned long" */ #define LINUX_SYS_arch_prctl 158 Index: linux/arch/amd64/linux_syscallargs.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/amd64/linux_syscallargs.h,v retrieving revision 1.85 diff -u -r1.85 linux_syscallargs.h --- linux/arch/amd64/linux_syscallargs.h 26 Oct 2025 16:25:16 -0000 1.85 +++ linux/arch/amd64/linux_syscallargs.h 10 Nov 2025 14:48:07 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscallargs.h,v 1.85 2025/10/26 16:25:16 christos Exp $ */ +/* $NetBSD$ */ /* * System call argument lists. @@ -652,6 +652,11 @@ }; check_syscall_args(linux_sys___sysctl) +struct linux_sys___prctl_args { + syscallarg(int) code; + syscallarg(void *) args[SYS_MAXSYSARGS]; +}; + struct linux_sys_arch_prctl_args { syscallarg(int) code; syscallarg(unsigned long) addr; @@ -1648,6 +1653,8 @@ int linux_sys___sysctl(struct lwp *, const struct linux_sys___sysctl_args *, register_t *); +int linux_sys___prctl(struct lwp *, const struct linux_sys___prctl_args *, register_t *); + int linux_sys_arch_prctl(struct lwp *, const struct linux_sys_arch_prctl_args *, register_t *); int linux_sys_setrlimit(struct lwp *, const struct linux_sys_setrlimit_args *, register_t *); Index: linux/arch/amd64/linux_syscalls.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/amd64/linux_syscalls.c,v retrieving revision 1.85 diff -u -r1.85 linux_syscalls.c --- linux/arch/amd64/linux_syscalls.c 26 Oct 2025 16:25:16 -0000 1.85 +++ linux/arch/amd64/linux_syscalls.c 10 Nov 2025 14:48:07 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscalls.c,v 1.85 2025/10/26 16:25:16 christos Exp $ */ +/* $NetBSD$ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.85 2025/10/26 16:25:16 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -227,7 +227,7 @@ /* 154 */ "modify_ldt", /* 155 */ "#155 (unimplemented pivot_root)", /* 156 */ "__sysctl", - /* 157 */ "#157 (unimplemented prctl)", + /* 157 */ "__prctl", /* 158 */ "arch_prctl", /* 159 */ "#159 (unimplemented adjtimex)", /* 160 */ "setrlimit", @@ -771,7 +771,7 @@ /* 154 */ NULL, /* modify_ldt */ /* 155 */ NULL, /* unimplemented pivot_root */ /* 156 */ NULL, /* __sysctl */ - /* 157 */ NULL, /* unimplemented prctl */ + /* 157 */ NULL, /* __prctl */ /* 158 */ NULL, /* arch_prctl */ /* 159 */ NULL, /* unimplemented adjtimex */ /* 160 */ NULL, /* setrlimit */ Index: linux/arch/amd64/linux_sysent.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/amd64/linux_sysent.c,v retrieving revision 1.85 diff -u -r1.85 linux_sysent.c --- linux/arch/amd64/linux_sysent.c 26 Oct 2025 16:25:16 -0000 1.85 +++ linux/arch/amd64/linux_sysent.c 10 Nov 2025 14:48:08 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysent.c,v 1.85 2025/10/26 16:25:16 christos Exp $ */ +/* $NetBSD$ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.85 2025/10/26 16:25:16 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -793,8 +793,10 @@ .sy_call = (sy_call_t *)linux_sys___sysctl }, /* 156 = __sysctl */ { - .sy_call = linux_sys_nosys, - }, /* 157 = filler */ + ns(struct linux_sys___prctl_args), + .sy_flags = SYCALL_ARG_PTR | SYCALL_INDIRECT, + .sy_call = (sy_call_t *)linux_sys___prctl + }, /* 157 = __prctl */ { ns(struct linux_sys_arch_prctl_args), .sy_call = (sy_call_t *)linux_sys_arch_prctl Index: linux/arch/amd64/linux_systrace_args.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/amd64/linux_systrace_args.c,v retrieving revision 1.29 diff -u -r1.29 linux_systrace_args.c --- linux/arch/amd64/linux_systrace_args.c 26 Oct 2025 16:25:16 -0000 1.29 +++ linux/arch/amd64/linux_systrace_args.c 10 Nov 2025 14:48:08 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_systrace_args.c,v 1.29 2025/10/26 16:25:16 christos Exp $ */ +/* $NetBSD$ */ /* * System call argument to DTrace register array conversion. @@ -1230,6 +1230,14 @@ *n_args = 1; break; } + /* linux_sys___prctl */ + case 157: { + const struct linux_sys___prctl_args *p = params; + iarg[0] = SCARG(p, code); /* int */ + uarg[1] = (intptr_t) SCARG(p, args[0]); /* void * */ + *n_args = 2; + break; + } /* linux_sys_arch_prctl */ case 158: { const struct linux_sys_arch_prctl_args *p = params; @@ -4187,6 +4195,19 @@ break; }; break; + /* linux_sys___prctl */ + case 157: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "void *"; + break; + default: + break; + }; + break; /* linux_sys_arch_prctl */ case 158: switch(ndx) { @@ -6614,6 +6635,11 @@ if (ndx == 0 || ndx == 1) p = "int"; break; + /* linux_sys___prctl */ + case 157: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_sys_arch_prctl */ case 158: if (ndx == 0 || ndx == 1) Index: linux/arch/amd64/syscalls.master =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/amd64/syscalls.master,v retrieving revision 1.76 diff -u -r1.76 syscalls.master --- linux/arch/amd64/syscalls.master 26 Oct 2025 16:19:05 -0000 1.76 +++ linux/arch/amd64/syscalls.master 10 Nov 2025 14:48:08 -0000 @@ -340,7 +340,8 @@ size_t bytecount); } 155 UNIMPL pivot_root 156 STD { int|linux_sys||__sysctl(struct linux___sysctl *lsp); } -157 UNIMPL prctl +157 INDIR { int|linux_sys||__prctl(int code, \ + ... void * args[SYS_MAXSYSARGS]); } 158 STD { int|linux_sys||arch_prctl(int code, \ unsigned long addr); } 159 UNIMPL adjtimex Index: linux/arch/arm/linux_syscall.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/arm/linux_syscall.h,v retrieving revision 1.96 diff -u -r1.96 linux_syscall.h --- linux/arch/arm/linux_syscall.h 26 Oct 2025 16:25:16 -0000 1.96 +++ linux/arch/arm/linux_syscall.h 10 Nov 2025 14:48:08 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscall.h,v 1.96 2025/10/26 16:25:16 christos Exp $ */ +/* $NetBSD$ */ /* * System call numbers. @@ -441,6 +441,9 @@ /* syscall: "getresgid16" ret: "int" args: "linux_gid16_t *" "linux_gid16_t *" "linux_gid16_t *" */ #define LINUX_SYS_getresgid16 171 +/* syscall: "__prctl" ret: "int" args: "int" "..." */ +#define LINUX_SYS___prctl 172 + /* syscall: "rt_sigaction" ret: "int" args: "int" "const struct linux_sigaction *" "struct linux_sigaction *" "size_t" */ #define LINUX_SYS_rt_sigaction 174 Index: linux/arch/arm/linux_syscallargs.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/arm/linux_syscallargs.h,v retrieving revision 1.96 diff -u -r1.96 linux_syscallargs.h --- linux/arch/arm/linux_syscallargs.h 26 Oct 2025 16:25:16 -0000 1.96 +++ linux/arch/arm/linux_syscallargs.h 10 Nov 2025 14:48:09 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscallargs.h,v 1.96 2025/10/26 16:25:16 christos Exp $ */ +/* $NetBSD$ */ /* * System call argument lists. @@ -604,6 +604,11 @@ }; check_syscall_args(linux_sys_getresgid16) +struct linux_sys___prctl_args { + syscallarg(int) code; + syscallarg(void *) args[SYS_MAXSYSARGS]; +}; + struct linux_sys_rt_sigaction_args { syscallarg(int) signum; syscallarg(const struct linux_sigaction *) nsa; @@ -1694,6 +1699,8 @@ int linux_sys_getresgid16(struct lwp *, const struct linux_sys_getresgid16_args *, register_t *); +int linux_sys___prctl(struct lwp *, const struct linux_sys___prctl_args *, register_t *); + int linux_sys_rt_sigaction(struct lwp *, const struct linux_sys_rt_sigaction_args *, register_t *); int linux_sys_rt_sigprocmask(struct lwp *, const struct linux_sys_rt_sigprocmask_args *, register_t *); Index: linux/arch/arm/linux_syscalls.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/arm/linux_syscalls.c,v retrieving revision 1.96 diff -u -r1.96 linux_syscalls.c --- linux/arch/arm/linux_syscalls.c 26 Oct 2025 16:25:16 -0000 1.96 +++ linux/arch/arm/linux_syscalls.c 10 Nov 2025 14:48:09 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscalls.c,v 1.96 2025/10/26 16:25:16 christos Exp $ */ +/* $NetBSD$ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.96 2025/10/26 16:25:16 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #include @@ -208,7 +208,7 @@ /* 169 */ "#169 (unimplemented nfsservctl)", /* 170 */ "setresgid16", /* 171 */ "getresgid16", - /* 172 */ "#172 (unimplemented prctl)", + /* 172 */ "__prctl", /* 173 */ "#173 (unimplemented rt_sigreturn)", /* 174 */ "rt_sigaction", /* 175 */ "rt_sigprocmask", @@ -730,7 +730,7 @@ /* 169 */ NULL, /* unimplemented nfsservctl */ /* 170 */ NULL, /* setresgid16 */ /* 171 */ NULL, /* getresgid16 */ - /* 172 */ NULL, /* unimplemented prctl */ + /* 172 */ NULL, /* __prctl */ /* 173 */ NULL, /* unimplemented rt_sigreturn */ /* 174 */ NULL, /* rt_sigaction */ /* 175 */ NULL, /* rt_sigprocmask */ Index: linux/arch/arm/linux_sysent.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/arm/linux_sysent.c,v retrieving revision 1.96 diff -u -r1.96 linux_sysent.c --- linux/arch/arm/linux_sysent.c 26 Oct 2025 16:25:16 -0000 1.96 +++ linux/arch/arm/linux_sysent.c 10 Nov 2025 14:48:09 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysent.c,v 1.96 2025/10/26 16:25:16 christos Exp $ */ +/* $NetBSD$ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.96 2025/10/26 16:25:16 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #include #include @@ -764,8 +764,10 @@ .sy_call = (sy_call_t *)linux_sys_getresgid16 }, /* 171 = getresgid16 */ { - .sy_call = linux_sys_nosys, - }, /* 172 = filler */ + ns(struct linux_sys___prctl_args), + .sy_flags = SYCALL_ARG_PTR | SYCALL_INDIRECT, + .sy_call = (sy_call_t *)linux_sys___prctl + }, /* 172 = __prctl */ { .sy_call = linux_sys_nosys, }, /* 173 = filler */ Index: linux/arch/arm/linux_systrace_args.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/arm/linux_systrace_args.c,v retrieving revision 1.29 diff -u -r1.29 linux_systrace_args.c --- linux/arch/arm/linux_systrace_args.c 26 Oct 2025 16:25:16 -0000 1.29 +++ linux/arch/arm/linux_systrace_args.c 10 Nov 2025 14:48:10 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_systrace_args.c,v 1.29 2025/10/26 16:25:16 christos Exp $ */ +/* $NetBSD$ */ /* * System call argument to DTrace register array conversion. @@ -1082,6 +1082,14 @@ *n_args = 3; break; } + /* linux_sys___prctl */ + case 172: { + const struct linux_sys___prctl_args *p = params; + iarg[0] = SCARG(p, code); /* int */ + uarg[1] = (intptr_t) SCARG(p, args[0]); /* void * */ + *n_args = 2; + break; + } /* linux_sys_rt_sigaction */ case 174: { const struct linux_sys_rt_sigaction_args *p = params; @@ -3974,6 +3982,19 @@ break; }; break; + /* linux_sys___prctl */ + case 172: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "void *"; + break; + default: + break; + }; + break; /* linux_sys_rt_sigaction */ case 174: switch(ndx) { @@ -6749,6 +6770,11 @@ if (ndx == 0 || ndx == 1) p = "int"; break; + /* linux_sys___prctl */ + case 172: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_sys_rt_sigaction */ case 174: if (ndx == 0 || ndx == 1) Index: linux/arch/arm/syscalls.master =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/arm/syscalls.master,v retrieving revision 1.84 diff -u -r1.84 syscalls.master --- linux/arch/arm/syscalls.master 26 Oct 2025 16:24:59 -0000 1.84 +++ linux/arch/arm/syscalls.master 10 Nov 2025 14:48:10 -0000 @@ -295,7 +295,8 @@ linux_gid16_t egid, linux_gid16_t sgid); } 171 STD { int|linux_sys||getresgid16(linux_gid16_t *rgid, \ linux_gid16_t *egid, linux_gid16_t *sgid); } -172 UNIMPL prctl +172 INDIR { int|linux_sys||__prctl(int code, \ + ... void * args[SYS_MAXSYSARGS]); } 173 UNIMPL rt_sigreturn ;173 STD { int|linux_sys||rt_sigreturn( \ ; struct linux_rt_sigframe *sfp); } Index: linux/arch/i386/linux_syscall.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/i386/linux_syscall.h,v retrieving revision 1.129 diff -u -r1.129 linux_syscall.h --- linux/arch/i386/linux_syscall.h 28 Sep 2024 19:36:20 -0000 1.129 +++ linux/arch/i386/linux_syscall.h 10 Nov 2025 14:48:10 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscall.h,v 1.129 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call numbers. @@ -451,6 +451,9 @@ /* syscall: "getresgid16" ret: "int" args: "linux_gid16_t *" "linux_gid16_t *" "linux_gid16_t *" */ #define LINUX_SYS_getresgid16 171 +/* syscall: "__prctl" ret: "int" args: "int" "..." */ +#define LINUX_SYS___prctl 172 + /* syscall: "rt_sigreturn" ret: "int" args: "struct linux_ucontext *" */ #define LINUX_SYS_rt_sigreturn 173 Index: linux/arch/i386/linux_syscallargs.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/i386/linux_syscallargs.h,v retrieving revision 1.129 diff -u -r1.129 linux_syscallargs.h --- linux/arch/i386/linux_syscallargs.h 28 Sep 2024 19:36:20 -0000 1.129 +++ linux/arch/i386/linux_syscallargs.h 10 Nov 2025 14:48:10 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscallargs.h,v 1.129 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call argument lists. @@ -622,6 +622,11 @@ }; check_syscall_args(linux_sys_getresgid16) +struct linux_sys___prctl_args { + syscallarg(int) code; + syscallarg(void *) args[SYS_MAXSYSARGS]; +}; + struct linux_sys_rt_sigreturn_args { syscallarg(struct linux_ucontext *) ucp; }; @@ -1712,6 +1717,8 @@ int linux_sys_getresgid16(struct lwp *, const struct linux_sys_getresgid16_args *, register_t *); +int linux_sys___prctl(struct lwp *, const struct linux_sys___prctl_args *, register_t *); + int linux_sys_rt_sigreturn(struct lwp *, const struct linux_sys_rt_sigreturn_args *, register_t *); int linux_sys_rt_sigaction(struct lwp *, const struct linux_sys_rt_sigaction_args *, register_t *); Index: linux/arch/i386/linux_syscalls.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/i386/linux_syscalls.c,v retrieving revision 1.130 diff -u -r1.130 linux_syscalls.c --- linux/arch/i386/linux_syscalls.c 28 Sep 2024 19:36:20 -0000 1.130 +++ linux/arch/i386/linux_syscalls.c 10 Nov 2025 14:48:10 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscalls.c,v 1.130 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.130 2024/09/28 19:36:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #include @@ -207,7 +207,7 @@ /* 169 */ "#169 (unimplemented nfsservctl)", /* 170 */ "setresgid16", /* 171 */ "getresgid16", - /* 172 */ "#172 (unimplemented prctl)", + /* 172 */ "__prctl", /* 173 */ "rt_sigreturn", /* 174 */ "rt_sigaction", /* 175 */ "rt_sigprocmask", @@ -729,7 +729,7 @@ /* 169 */ NULL, /* unimplemented nfsservctl */ /* 170 */ NULL, /* setresgid16 */ /* 171 */ NULL, /* getresgid16 */ - /* 172 */ NULL, /* unimplemented prctl */ + /* 172 */ NULL, /* __prctl */ /* 173 */ NULL, /* rt_sigreturn */ /* 174 */ NULL, /* rt_sigaction */ /* 175 */ NULL, /* rt_sigprocmask */ Index: linux/arch/i386/linux_sysent.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/i386/linux_sysent.c,v retrieving revision 1.129 diff -u -r1.129 linux_sysent.c --- linux/arch/i386/linux_sysent.c 28 Sep 2024 19:36:20 -0000 1.129 +++ linux/arch/i386/linux_sysent.c 10 Nov 2025 14:48:11 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysent.c,v 1.129 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.129 2024/09/28 19:36:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #include #include @@ -769,8 +769,10 @@ .sy_call = (sy_call_t *)linux_sys_getresgid16 }, /* 171 = getresgid16 */ { - .sy_call = linux_sys_nosys, - }, /* 172 = filler */ + ns(struct linux_sys___prctl_args), + .sy_flags = SYCALL_ARG_PTR | SYCALL_INDIRECT, + .sy_call = (sy_call_t *)linux_sys___prctl + }, /* 172 = __prctl */ { ns(struct linux_sys_rt_sigreturn_args), .sy_flags = SYCALL_ARG_PTR, Index: linux/arch/i386/linux_systrace_args.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/i386/linux_systrace_args.c,v retrieving revision 1.24 diff -u -r1.24 linux_systrace_args.c --- linux/arch/i386/linux_systrace_args.c 28 Sep 2024 19:36:20 -0000 1.24 +++ linux/arch/i386/linux_systrace_args.c 10 Nov 2025 14:48:11 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_systrace_args.c,v 1.24 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call argument to DTrace register array conversion. @@ -1114,6 +1114,14 @@ *n_args = 3; break; } + /* linux_sys___prctl */ + case 172: { + const struct linux_sys___prctl_args *p = params; + iarg[0] = SCARG(p, code); /* int */ + uarg[1] = (intptr_t) SCARG(p, args[0]); /* void * */ + *n_args = 2; + break; + } /* linux_sys_rt_sigreturn */ case 173: { const struct linux_sys_rt_sigreturn_args *p = params; @@ -4044,6 +4052,19 @@ break; }; break; + /* linux_sys___prctl */ + case 172: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "void *"; + break; + default: + break; + }; + break; /* linux_sys_rt_sigreturn */ case 173: switch(ndx) { @@ -6809,6 +6830,11 @@ if (ndx == 0 || ndx == 1) p = "int"; break; + /* linux_sys___prctl */ + case 172: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_sys_rt_sigreturn */ case 173: if (ndx == 0 || ndx == 1) Index: linux/arch/i386/syscalls.master =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/i386/syscalls.master,v retrieving revision 1.137 diff -u -r1.137 syscalls.master --- linux/arch/i386/syscalls.master 28 Sep 2024 19:35:55 -0000 1.137 +++ linux/arch/i386/syscalls.master 10 Nov 2025 14:48:12 -0000 @@ -296,7 +296,8 @@ linux_gid16_t egid, linux_gid16_t sgid); } 171 STD { int|linux_sys||getresgid16(linux_gid16_t *rgid, \ linux_gid16_t *egid, linux_gid16_t *sgid); } -172 UNIMPL prctl +172 INDIR { int|linux_sys||__prctl(int code, \ + ... void * args[SYS_MAXSYSARGS]); } 173 STD { int|linux_sys||rt_sigreturn( \ struct linux_ucontext *ucp); } 174 STD { int|linux_sys||rt_sigaction(int signum, \ Index: linux/arch/m68k/linux_syscall.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/m68k/linux_syscall.h,v retrieving revision 1.120 diff -u -r1.120 linux_syscall.h --- linux/arch/m68k/linux_syscall.h 28 Sep 2024 19:36:20 -0000 1.120 +++ linux/arch/m68k/linux_syscall.h 10 Nov 2025 14:48:12 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscall.h,v 1.120 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call numbers. @@ -449,6 +449,9 @@ /* syscall: "getresgid16" ret: "int" args: "linux_gid16_t *" "linux_gid16_t *" "linux_gid16_t *" */ #define LINUX_SYS_getresgid16 171 +/* syscall: "__prctl" ret: "int" args: "int" "..." */ +#define LINUX_SYS___prctl 172 + /* syscall: "rt_sigreturn" ret: "int" args: */ #define LINUX_SYS_rt_sigreturn 173 Index: linux/arch/m68k/linux_syscallargs.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/m68k/linux_syscallargs.h,v retrieving revision 1.119 diff -u -r1.119 linux_syscallargs.h --- linux/arch/m68k/linux_syscallargs.h 28 Sep 2024 19:36:20 -0000 1.119 +++ linux/arch/m68k/linux_syscallargs.h 10 Nov 2025 14:48:12 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscallargs.h,v 1.119 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call argument lists. @@ -603,6 +603,11 @@ }; check_syscall_args(linux_sys_getresgid16) +struct linux_sys___prctl_args { + syscallarg(int) code; + syscallarg(void *) args[SYS_MAXSYSARGS]; +}; + struct linux_sys_rt_sigaction_args { syscallarg(int) signum; syscallarg(const struct linux_sigaction *) nsa; @@ -1685,6 +1690,8 @@ int linux_sys_getresgid16(struct lwp *, const struct linux_sys_getresgid16_args *, register_t *); +int linux_sys___prctl(struct lwp *, const struct linux_sys___prctl_args *, register_t *); + int linux_sys_rt_sigreturn(struct lwp *, const void *, register_t *); int linux_sys_rt_sigaction(struct lwp *, const struct linux_sys_rt_sigaction_args *, register_t *); Index: linux/arch/m68k/linux_syscalls.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/m68k/linux_syscalls.c,v retrieving revision 1.120 diff -u -r1.120 linux_syscalls.c --- linux/arch/m68k/linux_syscalls.c 28 Sep 2024 19:36:20 -0000 1.120 +++ linux/arch/m68k/linux_syscalls.c 10 Nov 2025 14:48:12 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscalls.c,v 1.120 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.120 2024/09/28 19:36:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -227,7 +227,7 @@ /* 169 */ "#169 (unimplemented nfsservctl)", /* 170 */ "setresgid16", /* 171 */ "getresgid16", - /* 172 */ "#172 (unimplemented prctl)", + /* 172 */ "__prctl", /* 173 */ "rt_sigreturn", /* 174 */ "rt_sigaction", /* 175 */ "rt_sigprocmask", @@ -765,7 +765,7 @@ /* 169 */ NULL, /* unimplemented nfsservctl */ /* 170 */ NULL, /* setresgid16 */ /* 171 */ NULL, /* getresgid16 */ - /* 172 */ NULL, /* unimplemented prctl */ + /* 172 */ NULL, /* __prctl */ /* 173 */ NULL, /* rt_sigreturn */ /* 174 */ NULL, /* rt_sigaction */ /* 175 */ NULL, /* rt_sigprocmask */ Index: linux/arch/m68k/linux_sysent.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/m68k/linux_sysent.c,v retrieving revision 1.120 diff -u -r1.120 linux_sysent.c --- linux/arch/m68k/linux_sysent.c 28 Sep 2024 19:36:20 -0000 1.120 +++ linux/arch/m68k/linux_sysent.c 10 Nov 2025 14:48:12 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysent.c,v 1.120 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.120 2024/09/28 19:36:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -786,8 +786,10 @@ .sy_call = (sy_call_t *)linux_sys_getresgid16 }, /* 171 = getresgid16 */ { - .sy_call = linux_sys_nosys, - }, /* 172 = filler */ + ns(struct linux_sys___prctl_args), + .sy_flags = SYCALL_ARG_PTR | SYCALL_INDIRECT, + .sy_call = (sy_call_t *)linux_sys___prctl + }, /* 172 = __prctl */ { .sy_call = (sy_call_t *)linux_sys_rt_sigreturn }, /* 173 = rt_sigreturn */ Index: linux/arch/m68k/syscalls.master =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/m68k/syscalls.master,v retrieving revision 1.107 diff -u -r1.107 syscalls.master --- linux/arch/m68k/syscalls.master 28 Sep 2024 19:35:56 -0000 1.107 +++ linux/arch/m68k/syscalls.master 10 Nov 2025 14:48:12 -0000 @@ -315,7 +315,8 @@ linux_gid16_t egid, linux_gid16_t sgid); } 171 STD { int|linux_sys||getresgid16(linux_gid16_t *rgid, \ linux_gid16_t *egid, linux_gid16_t *sgid); } -172 UNIMPL prctl +172 INDIR { int|linux_sys||__prctl(int code, \ + ... void * args[SYS_MAXSYSARGS]); } 173 STD { int|linux_sys||rt_sigreturn(void); } 174 STD { int|linux_sys||rt_sigaction(int signum, \ const struct linux_sigaction *nsa, \ Index: linux/arch/mips/linux_syscall.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/mips/linux_syscall.h,v retrieving revision 1.93 diff -u -r1.93 linux_syscall.h --- linux/arch/mips/linux_syscall.h 28 Sep 2024 19:36:20 -0000 1.93 +++ linux/arch/mips/linux_syscall.h 10 Nov 2025 14:48:13 -0000 @@ -1,10 +1,10 @@ -/* $NetBSD: linux_syscall.h,v 1.93 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.82 2024/09/28 19:35:56 christos Exp + * created from NetBSD: syscalls.master,v 1.83 2024/10/01 16:29:15 riastradh Exp */ #ifndef _LINUX_SYS_SYSCALL_H_ @@ -478,6 +478,9 @@ /* syscall: "getresgid" ret: "int" args: "gid_t *" "gid_t *" "gid_t *" */ #define LINUX_SYS_getresgid 191 +/* syscall: "__prctl" ret: "int" args: "int" "..." */ +#define LINUX_SYS___prctl 192 + /* syscall: "rt_sigreturn" ret: "int" args: "struct linux_pt_regs *" */ #define LINUX_SYS_rt_sigreturn 193 Index: linux/arch/mips/linux_syscallargs.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/mips/linux_syscallargs.h,v retrieving revision 1.92 diff -u -r1.92 linux_syscallargs.h --- linux/arch/mips/linux_syscallargs.h 28 Sep 2024 19:36:20 -0000 1.92 +++ linux/arch/mips/linux_syscallargs.h 10 Nov 2025 14:48:13 -0000 @@ -1,10 +1,10 @@ -/* $NetBSD: linux_syscallargs.h,v 1.92 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.82 2024/09/28 19:35:56 christos Exp + * created from NetBSD: syscalls.master,v 1.83 2024/10/01 16:29:15 riastradh Exp */ #ifndef _LINUX_SYS_SYSCALLARGS_H_ @@ -702,6 +702,11 @@ }; check_syscall_args(linux_sys_getresgid) +struct linux_sys___prctl_args { + syscallarg(int) code; + syscallarg(void *) args[SYS_MAXSYSARGS]; +}; + struct linux_sys_rt_sigreturn_args { syscallarg(struct linux_pt_regs *) regs; }; @@ -1749,6 +1754,8 @@ int linux_sys_getresgid(struct lwp *, const struct linux_sys_getresgid_args *, register_t *); +int linux_sys___prctl(struct lwp *, const struct linux_sys___prctl_args *, register_t *); + int linux_sys_rt_sigreturn(struct lwp *, const struct linux_sys_rt_sigreturn_args *, register_t *); int linux_sys_rt_sigaction(struct lwp *, const struct linux_sys_rt_sigaction_args *, register_t *); Index: linux/arch/mips/linux_syscalls.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/mips/linux_syscalls.c,v retrieving revision 1.92 diff -u -r1.92 linux_syscalls.c --- linux/arch/mips/linux_syscalls.c 28 Sep 2024 19:36:20 -0000 1.92 +++ linux/arch/mips/linux_syscalls.c 10 Nov 2025 14:48:13 -0000 @@ -1,14 +1,14 @@ -/* $NetBSD: linux_syscalls.c,v 1.92 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.82 2024/09/28 19:35:56 christos Exp + * created from NetBSD: syscalls.master,v 1.83 2024/10/01 16:29:15 riastradh Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.92 2024/09/28 19:36:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #include @@ -224,7 +224,7 @@ /* 189 */ "#189 (unimplemented nfsservctl)", /* 190 */ "setresgid", /* 191 */ "getresgid", - /* 192 */ "#192 (unimplemented prctl)", + /* 192 */ "__prctl", /* 193 */ "rt_sigreturn", /* 194 */ "rt_sigaction", /* 195 */ "rt_sigprocmask", @@ -741,7 +741,7 @@ /* 189 */ NULL, /* unimplemented nfsservctl */ /* 190 */ NULL, /* setresgid */ /* 191 */ NULL, /* getresgid */ - /* 192 */ NULL, /* unimplemented prctl */ + /* 192 */ NULL, /* __prctl */ /* 193 */ NULL, /* rt_sigreturn */ /* 194 */ NULL, /* rt_sigaction */ /* 195 */ NULL, /* rt_sigprocmask */ Index: linux/arch/mips/linux_sysent.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/mips/linux_sysent.c,v retrieving revision 1.92 diff -u -r1.92 linux_sysent.c --- linux/arch/mips/linux_sysent.c 28 Sep 2024 19:36:20 -0000 1.92 +++ linux/arch/mips/linux_sysent.c 10 Nov 2025 14:48:13 -0000 @@ -1,14 +1,14 @@ -/* $NetBSD: linux_sysent.c,v 1.92 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.82 2024/09/28 19:35:56 christos Exp + * created from NetBSD: syscalls.master,v 1.83 2024/10/01 16:29:15 riastradh Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.92 2024/09/28 19:36:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #include #include @@ -845,8 +845,10 @@ .sy_call = (sy_call_t *)linux_sys_getresgid }, /* 191 = getresgid */ { - .sy_call = linux_sys_nosys, - }, /* 192 = filler */ + ns(struct linux_sys___prctl_args), + .sy_flags = SYCALL_ARG_PTR | SYCALL_INDIRECT, + .sy_call = (sy_call_t *)linux_sys___prctl + }, /* 192 = __prctl */ { ns(struct linux_sys_rt_sigreturn_args), .sy_flags = SYCALL_ARG_PTR, Index: linux/arch/mips/syscalls.master =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/mips/syscalls.master,v retrieving revision 1.83 diff -u -r1.83 syscalls.master --- linux/arch/mips/syscalls.master 1 Oct 2024 16:29:15 -0000 1.83 +++ linux/arch/mips/syscalls.master 10 Nov 2025 14:48:13 -0000 @@ -331,7 +331,8 @@ gid_t sgid); } 191 STD { int|linux_sys||getresgid(gid_t *rgid, gid_t *egid, \ gid_t *sgid); } -192 UNIMPL prctl +192 INDIR { int|linux_sys||__prctl(int code, \ + ... void * args[SYS_MAXSYSARGS]); } 193 STD { int|linux_sys||rt_sigreturn( \ struct linux_pt_regs *regs); } 194 STD { int|linux_sys||rt_sigaction(int signum, \ Index: linux/arch/powerpc/linux_syscall.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/powerpc/linux_syscall.h,v retrieving revision 1.99 diff -u -r1.99 linux_syscall.h --- linux/arch/powerpc/linux_syscall.h 28 Sep 2024 19:36:20 -0000 1.99 +++ linux/arch/powerpc/linux_syscall.h 10 Nov 2025 14:48:13 -0000 @@ -1,10 +1,10 @@ -/* $NetBSD: linux_syscall.h,v 1.99 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.87 2024/09/28 19:35:56 christos Exp + * created from NetBSD: syscalls.master,v 1.88 2024/10/01 16:29:15 riastradh Exp */ #ifndef _LINUX_SYS_SYSCALL_H_ @@ -440,6 +440,9 @@ /* syscall: "getresgid" ret: "int" args: "gid_t *" "gid_t *" "gid_t *" */ #define LINUX_SYS_getresgid 170 +/* syscall: "__prctl" ret: "int" args: "int" "..." */ +#define LINUX_SYS___prctl 171 + /* syscall: "rt_sigreturn" ret: "int" args: "struct linux_rt_sigframe *" */ #define LINUX_SYS_rt_sigreturn 172 Index: linux/arch/powerpc/linux_syscallargs.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/powerpc/linux_syscallargs.h,v retrieving revision 1.98 diff -u -r1.98 linux_syscallargs.h --- linux/arch/powerpc/linux_syscallargs.h 28 Sep 2024 19:36:20 -0000 1.98 +++ linux/arch/powerpc/linux_syscallargs.h 10 Nov 2025 14:48:13 -0000 @@ -1,10 +1,10 @@ -/* $NetBSD: linux_syscallargs.h,v 1.98 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.87 2024/09/28 19:35:56 christos Exp + * created from NetBSD: syscalls.master,v 1.88 2024/10/01 16:29:15 riastradh Exp */ #ifndef _LINUX_SYS_SYSCALLARGS_H_ @@ -579,6 +579,11 @@ }; check_syscall_args(linux_sys_getresgid) +struct linux_sys___prctl_args { + syscallarg(int) code; + syscallarg(void *) args[SYS_MAXSYSARGS]; +}; + struct linux_sys_rt_sigreturn_args { syscallarg(struct linux_rt_sigframe *) sfp; }; @@ -1609,6 +1614,8 @@ int linux_sys_getresgid(struct lwp *, const struct linux_sys_getresgid_args *, register_t *); +int linux_sys___prctl(struct lwp *, const struct linux_sys___prctl_args *, register_t *); + int linux_sys_rt_sigreturn(struct lwp *, const struct linux_sys_rt_sigreturn_args *, register_t *); int linux_sys_rt_sigaction(struct lwp *, const struct linux_sys_rt_sigaction_args *, register_t *); Index: linux/arch/powerpc/linux_syscalls.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/powerpc/linux_syscalls.c,v retrieving revision 1.98 diff -u -r1.98 linux_syscalls.c --- linux/arch/powerpc/linux_syscalls.c 28 Sep 2024 19:36:20 -0000 1.98 +++ linux/arch/powerpc/linux_syscalls.c 10 Nov 2025 14:48:14 -0000 @@ -1,14 +1,14 @@ -/* $NetBSD: linux_syscalls.c,v 1.98 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.87 2024/09/28 19:35:56 christos Exp + * created from NetBSD: syscalls.master,v 1.88 2024/10/01 16:29:15 riastradh Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.98 2024/09/28 19:36:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #include @@ -205,7 +205,7 @@ /* 168 */ "#168 (unimplemented nfsservctl)", /* 169 */ "setresgid", /* 170 */ "getresgid", - /* 171 */ "#171 (unimplemented prctl)", + /* 171 */ "__prctl", /* 172 */ "rt_sigreturn", /* 173 */ "rt_sigaction", /* 174 */ "rt_sigprocmask", @@ -727,7 +727,7 @@ /* 168 */ NULL, /* unimplemented nfsservctl */ /* 169 */ NULL, /* setresgid */ /* 170 */ NULL, /* getresgid */ - /* 171 */ NULL, /* unimplemented prctl */ + /* 171 */ NULL, /* __prctl */ /* 172 */ NULL, /* rt_sigreturn */ /* 173 */ NULL, /* rt_sigaction */ /* 174 */ NULL, /* rt_sigprocmask */ Index: linux/arch/powerpc/linux_sysent.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/powerpc/linux_sysent.c,v retrieving revision 1.99 diff -u -r1.99 linux_sysent.c --- linux/arch/powerpc/linux_sysent.c 28 Sep 2024 19:36:20 -0000 1.99 +++ linux/arch/powerpc/linux_sysent.c 10 Nov 2025 14:48:14 -0000 @@ -1,14 +1,14 @@ -/* $NetBSD: linux_sysent.c,v 1.99 2024/09/28 19:36:20 christos Exp $ */ +/* $NetBSD$ */ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.87 2024/09/28 19:35:56 christos Exp + * created from NetBSD: syscalls.master,v 1.88 2024/10/01 16:29:15 riastradh Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.99 2024/09/28 19:36:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #include #include @@ -758,8 +758,10 @@ .sy_call = (sy_call_t *)linux_sys_getresgid }, /* 170 = getresgid */ { - .sy_call = linux_sys_nosys, - }, /* 171 = filler */ + ns(struct linux_sys___prctl_args), + .sy_flags = SYCALL_ARG_PTR | SYCALL_INDIRECT, + .sy_call = (sy_call_t *)linux_sys___prctl + }, /* 171 = __prctl */ { ns(struct linux_sys_rt_sigreturn_args), .sy_flags = SYCALL_ARG_PTR, Index: linux/arch/powerpc/syscalls.master =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/powerpc/syscalls.master,v retrieving revision 1.88 diff -u -r1.88 syscalls.master --- linux/arch/powerpc/syscalls.master 1 Oct 2024 16:29:15 -0000 1.88 +++ linux/arch/powerpc/syscalls.master 10 Nov 2025 14:48:14 -0000 @@ -319,7 +319,8 @@ gid_t sgid); } 170 STD { int|linux_sys||getresgid(gid_t *rgid, gid_t *egid, \ gid_t *sgid); } -171 UNIMPL prctl +171 INDIR { int|linux_sys||__prctl(int code, \ + ... void * args[SYS_MAXSYSARGS]); } 172 STD { int|linux_sys||rt_sigreturn( \ struct linux_rt_sigframe *sfp); } 173 STD { int|linux_sys||rt_sigaction(int signum, \ Index: linux/common/linux_prctl.h =================================================================== RCS file: /cvsroot/src/sys/compat/linux/common/linux_prctl.h,v retrieving revision 1.5 diff -u -r1.5 linux_prctl.h --- linux/common/linux_prctl.h 1 Oct 2024 16:41:29 -0000 1.5 +++ linux/common/linux_prctl.h 10 Nov 2025 14:48:14 -0000 @@ -34,7 +34,9 @@ #ifndef _LINUX_PRCTL_H #define _LINUX_PRCTL_H -/* arch independent prctl(2): not yet implemented */ +/* arch independent prctl(2) */ +#define LINUX_PR_SET_NAME 15 +#define LINUX_PR_GET_NAME 16 /* arch specific arch_prctl(2): only on amd64 so far */ #if defined(__amd64__) Index: linux/common/linux_sched.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/common/linux_sched.c,v retrieving revision 1.85 diff -u -r1.85 linux_sched.c --- linux/common/linux_sched.c 19 Sep 2025 19:35:15 -0000 1.85 +++ linux/common/linux_sched.c 10 Nov 2025 14:48:14 -0000 @@ -62,6 +62,8 @@ #include +#include + static int linux_clone_nptl(struct lwp *, const struct linux_sys_clone_args *, register_t *); @@ -782,3 +784,35 @@ return sys__sched_setaffinity(l, &ssa, retval); } + +int +linux_sys___prctl(struct lwp *l, const struct linux_sys___prctl_args *uap, + register_t *retval) +{ + /* { + syscallarg(int) code; + syscallarg(void *) args[SYS_MAXSYSARGS]; + } */ + + unsigned int c = SCARG(uap, code); + + /* TODO: add other commonly used prctl codes */ + switch(c) { + case LINUX_PR_SET_NAME: { + struct sys__lwp_setname_args sls; + SCARG(&sls, name) = (char *) SCARG(uap, args[0]); + return sys__lwp_setname(l, &sls, retval); + } + + case LINUX_PR_GET_NAME: { + struct sys__lwp_getname_args slg; + SCARG(&slg, name) = (char *) SCARG(uap, args[0]); + SCARG(&slg, len) = MAXCOMLEN; + return sys__lwp_getname(l, &slg, retval); + } + default: + printf("Unimplemented linux prctl code: (%d)", c); + return ENOSYS; + } + +}