diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h index eb9f9d306af9..b79832ddfe34 100644 --- a/sys/compat/freebsd32/freebsd32_syscall.h +++ b/sys/compat/freebsd32/freebsd32_syscall.h @@ -497,4 +497,5 @@ #define FREEBSD32_SYS_funlinkat 568 #define FREEBSD32_SYS_copy_file_range 569 #define FREEBSD32_SYS_freebsd32___sysctlbyname 570 -#define FREEBSD32_SYS_MAXSYSCALL 571 +#define FREEBSD32_SYS_shm_open2 571 +#define FREEBSD32_SYS_MAXSYSCALL 572 diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c index 8b94310a48df..a1a45b3988c7 100644 --- a/sys/compat/freebsd32/freebsd32_syscalls.c +++ b/sys/compat/freebsd32/freebsd32_syscalls.c @@ -607,4 +607,5 @@ const char *freebsd32_syscallnames[] = { "funlinkat", /* 568 = funlinkat */ "copy_file_range", /* 569 = copy_file_range */ "freebsd32___sysctlbyname", /* 570 = freebsd32___sysctlbyname */ + "shm_open2", /* 571 = shm_open2 */ }; diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c index fa6808682f1e..c87f9e4654fd 100644 --- a/sys/compat/freebsd32/freebsd32_sysent.c +++ b/sys/compat/freebsd32/freebsd32_sysent.c @@ -654,4 +654,5 @@ struct sysent freebsd32_sysent[] = { { AS(funlinkat_args), (sy_call_t *)sys_funlinkat, AUE_UNLINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 568 = funlinkat */ { AS(copy_file_range_args), (sy_call_t *)sys_copy_file_range, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 569 = copy_file_range */ { AS(freebsd32___sysctlbyname_args), (sy_call_t *)freebsd32___sysctlbyname, AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 570 = freebsd32___sysctlbyname */ + { AS(shm_open2_args), (sy_call_t *)sys_shm_open2, AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 571 = shm_open2 */ }; diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c index eb4f56b826b9..d3655038c737 100644 --- a/sys/compat/freebsd32/freebsd32_systrace_args.c +++ b/sys/compat/freebsd32/freebsd32_systrace_args.c @@ -3344,6 +3344,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 6; break; } + /* shm_open2 */ + case 571: { + struct shm_open2_args *p = params; + uarg[0] = (intptr_t) p->path; /* const char * */ + iarg[1] = p->flags; /* int */ + iarg[2] = p->mode; /* mode_t */ + iarg[3] = p->shmflags; /* int */ + uarg[4] = (intptr_t) p->name; /* const char * */ + *n_args = 5; + break; + } default: *n_args = 0; break; @@ -9008,6 +9019,28 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; + /* shm_open2 */ + case 571: + switch(ndx) { + case 0: + p = "userland const char *"; + break; + case 1: + p = "int"; + break; + case 2: + p = "mode_t"; + break; + case 3: + p = "int"; + break; + case 4: + p = "userland const char *"; + break; + default: + break; + }; + break; default: break; }; @@ -10892,6 +10925,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; + /* shm_open2 */ + case 571: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index 34546b605e24..53b969739785 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -620,4 +620,5 @@ struct sysent sysent[] = { { AS(funlinkat_args), (sy_call_t *)sys_funlinkat, AUE_UNLINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 568 = funlinkat */ { AS(copy_file_range_args), (sy_call_t *)sys_copy_file_range, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 569 = copy_file_range */ { AS(__sysctlbyname_args), (sy_call_t *)sys___sysctlbyname, AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 570 = __sysctlbyname */ + { AS(shm_open2_args), (sy_call_t *)sys_shm_open2, AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 571 = shm_open2 */ }; diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c index 498298e45dba..d9b361da2f31 100644 --- a/sys/kern/syscalls.c +++ b/sys/kern/syscalls.c @@ -577,4 +577,5 @@ const char *syscallnames[] = { "funlinkat", /* 568 = funlinkat */ "copy_file_range", /* 569 = copy_file_range */ "__sysctlbyname", /* 570 = __sysctlbyname */ + "shm_open2", /* 571 = shm_open2 */ }; diff --git a/sys/kern/systrace_args.c b/sys/kern/systrace_args.c index 232e464896ef..0ea576919c24 100644 --- a/sys/kern/systrace_args.c +++ b/sys/kern/systrace_args.c @@ -3336,6 +3336,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 6; break; } + /* shm_open2 */ + case 571: { + struct shm_open2_args *p = params; + uarg[0] = (intptr_t) p->path; /* const char * */ + iarg[1] = p->flags; /* int */ + iarg[2] = p->mode; /* mode_t */ + iarg[3] = p->shmflags; /* int */ + uarg[4] = (intptr_t) p->name; /* const char * */ + *n_args = 5; + break; + } default: *n_args = 0; break; @@ -8913,6 +8924,28 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; + /* shm_open2 */ + case 571: + switch(ndx) { + case 0: + p = "userland const char *"; + break; + case 1: + p = "int"; + break; + case 2: + p = "mode_t"; + break; + case 3: + p = "int"; + break; + case 4: + p = "userland const char *"; + break; + default: + break; + }; + break; default: break; }; @@ -10824,6 +10857,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; + /* shm_open2 */ + case 571: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h index b263285ace5e..d1a0c5967e3d 100644 --- a/sys/sys/syscall.h +++ b/sys/sys/syscall.h @@ -506,4 +506,5 @@ #define SYS_funlinkat 568 #define SYS_copy_file_range 569 #define SYS___sysctlbyname 570 -#define SYS_MAXSYSCALL 571 +#define SYS_shm_open2 571 +#define SYS_MAXSYSCALL 572 diff --git a/sys/sys/syscall.mk b/sys/sys/syscall.mk index d19a410170b2..b85e9cea73c0 100644 --- a/sys/sys/syscall.mk +++ b/sys/sys/syscall.mk @@ -411,4 +411,5 @@ MIASM = \ fhreadlink.o \ funlinkat.o \ copy_file_range.o \ - __sysctlbyname.o + __sysctlbyname.o \ + shm_open2.o diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h index 5de3ce619204..b0f92e750ef0 100644 --- a/sys/sys/sysproto.h +++ b/sys/sys/sysproto.h @@ -1812,6 +1812,13 @@ struct __sysctlbyname_args { char new_l_[PADL_(void *)]; void * new; char new_r_[PADR_(void *)]; char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)]; }; +struct shm_open2_args { + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; + char shmflags_l_[PADL_(int)]; int shmflags; char shmflags_r_[PADR_(int)]; + char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2199,6 +2206,7 @@ int sys_fhreadlink(struct thread *, struct fhreadlink_args *); int sys_funlinkat(struct thread *, struct funlinkat_args *); int sys_copy_file_range(struct thread *, struct copy_file_range_args *); int sys___sysctlbyname(struct thread *, struct __sysctlbyname_args *); +int sys_shm_open2(struct thread *, struct shm_open2_args *); #ifdef COMPAT_43 @@ -3114,6 +3122,7 @@ int freebsd11_mknodat(struct thread *, struct freebsd11_mknodat_args *); #define SYS_AUE_funlinkat AUE_UNLINKAT #define SYS_AUE_copy_file_range AUE_NULL #define SYS_AUE___sysctlbyname AUE_SYSCTL +#define SYS_AUE_shm_open2 AUE_SHMOPEN #undef PAD_ #undef PADL_