add sendmmsg and recvmmsg

This commit is contained in:
christos 2017-02-03 16:18:19 +00:00
parent 37eb9fdea3
commit 69d5c34487
6 changed files with 125 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_syscall.h,v 1.65 2017/02/02 15:36:12 christos Exp $ */
/* $NetBSD: linux_syscall.h,v 1.66 2017/02/03 16:18:19 christos Exp $ */
/*
* System call numbers.
@ -654,6 +654,12 @@
/* syscall: "pipe2" ret: "int" args: "int *" "int" */
#define LINUX_SYS_pipe2 293
/* syscall: "recvmmsg" ret: "int" args: "int" "struct linux_mmsghdr *" "unsigned int" "unsigned int" "struct timespec *" */
#define LINUX_SYS_recvmmsg 299
/* syscall: "sendmmsg" ret: "int" args: "int" "struct linux_mmsghdr *" "unsigned int" "unsigned int" */
#define LINUX_SYS_sendmmsg 307
/* syscall: "nosys" ret: "int" args: */
#define LINUX_SYS_nosys 314

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_syscallargs.h,v 1.65 2017/02/02 15:36:12 christos Exp $ */
/* $NetBSD: linux_syscallargs.h,v 1.66 2017/02/03 16:18:19 christos Exp $ */
/*
* System call argument lists.
@ -1025,6 +1025,23 @@ struct linux_sys_pipe2_args {
};
check_syscall_args(linux_sys_pipe2)
struct linux_sys_recvmmsg_args {
syscallarg(int) s;
syscallarg(struct linux_mmsghdr *) msgvec;
syscallarg(unsigned int) vlen;
syscallarg(unsigned int) flags;
syscallarg(struct timespec *) timeout;
};
check_syscall_args(linux_sys_recvmmsg)
struct linux_sys_sendmmsg_args {
syscallarg(int) s;
syscallarg(struct linux_mmsghdr *) msgvec;
syscallarg(unsigned int) vlen;
syscallarg(unsigned int) flags;
};
check_syscall_args(linux_sys_sendmmsg)
/*
* System call prototypes.
*/
@ -1462,6 +1479,10 @@ int linux_sys_dup3(struct lwp *, const struct linux_sys_dup3_args *, register_t
int linux_sys_pipe2(struct lwp *, const struct linux_sys_pipe2_args *, register_t *);
int linux_sys_recvmmsg(struct lwp *, const struct linux_sys_recvmmsg_args *, register_t *);
int linux_sys_sendmmsg(struct lwp *, const struct linux_sys_sendmmsg_args *, register_t *);
int linux_sys_nosys(struct lwp *, const void *, register_t *);
#endif /* _LINUX_SYS_SYSCALLARGS_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_syscalls.c,v 1.65 2017/02/02 15:36:12 christos Exp $ */
/* $NetBSD: linux_syscalls.c,v 1.66 2017/02/03 16:18:19 christos Exp $ */
/*
* System call names.
@ -8,7 +8,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.65 2017/02/02 15:36:12 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.66 2017/02/03 16:18:19 christos Exp $");
#if defined(_KERNEL_OPT)
#if defined(_KERNEL_OPT)
@ -365,7 +365,7 @@ const char *const linux_syscallnames[] = {
/* 296 */ "#296 (unimplemented pwritev)",
/* 297 */ "#297 (unimplemented rt_tgsigqueueinfo)",
/* 298 */ "#298 (unimplemented perf_counter_open)",
/* 299 */ "#299 (unimplemented recvmmsg)",
/* 299 */ "recvmmsg",
/* 300 */ "#300 (unimplemented fanotify_init)",
/* 301 */ "#301 (unimplemented fanotify_mark)",
/* 302 */ "#302 (unimplemented prlimit64)",
@ -373,7 +373,7 @@ const char *const linux_syscallnames[] = {
/* 304 */ "#304 (unimplemented open_by_handle_at)",
/* 305 */ "#305 (unimplemented clock_adjtime)",
/* 306 */ "#306 (unimplemented syncfs)",
/* 307 */ "#307 (unimplemented sendmmsg)",
/* 307 */ "sendmmsg",
/* 308 */ "#308 (unimplemented setns)",
/* 309 */ "#309 (unimplemented getcpu)",
/* 310 */ "#310 (unimplemented process_vm_readv)",
@ -909,7 +909,7 @@ const char *const altlinux_syscallnames[] = {
/* 296 */ NULL, /* unimplemented pwritev */
/* 297 */ NULL, /* unimplemented rt_tgsigqueueinfo */
/* 298 */ NULL, /* unimplemented perf_counter_open */
/* 299 */ NULL, /* unimplemented recvmmsg */
/* 299 */ NULL, /* recvmmsg */
/* 300 */ NULL, /* unimplemented fanotify_init */
/* 301 */ NULL, /* unimplemented fanotify_mark */
/* 302 */ NULL, /* unimplemented prlimit64 */
@ -917,7 +917,7 @@ const char *const altlinux_syscallnames[] = {
/* 304 */ NULL, /* unimplemented open_by_handle_at */
/* 305 */ NULL, /* unimplemented clock_adjtime */
/* 306 */ NULL, /* unimplemented syncfs */
/* 307 */ NULL, /* unimplemented sendmmsg */
/* 307 */ NULL, /* sendmmsg */
/* 308 */ NULL, /* unimplemented setns */
/* 309 */ NULL, /* unimplemented getcpu */
/* 310 */ NULL, /* unimplemented process_vm_readv */

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_sysent.c,v 1.65 2017/02/02 15:36:12 christos Exp $ */
/* $NetBSD: linux_sysent.c,v 1.66 2017/02/03 16:18:19 christos Exp $ */
/*
* System call switch table.
@ -8,7 +8,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.65 2017/02/02 15:36:12 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.66 2017/02/03 16:18:19 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_sysv.h"
@ -1326,8 +1326,10 @@ struct sysent linux_sysent[] = {
.sy_call = linux_sys_nosys,
}, /* 298 = filler */
{
.sy_call = linux_sys_nosys,
}, /* 299 = filler */
ns(struct linux_sys_recvmmsg_args),
.sy_flags = SYCALL_ARG_PTR,
.sy_call = (sy_call_t *)linux_sys_recvmmsg
}, /* 299 = recvmmsg */
{
.sy_call = linux_sys_nosys,
}, /* 300 = filler */
@ -1350,8 +1352,10 @@ struct sysent linux_sysent[] = {
.sy_call = linux_sys_nosys,
}, /* 306 = filler */
{
.sy_call = linux_sys_nosys,
}, /* 307 = filler */
ns(struct linux_sys_sendmmsg_args),
.sy_flags = SYCALL_ARG_PTR,
.sy_call = (sy_call_t *)linux_sys_sendmmsg
}, /* 307 = sendmmsg */
{
.sy_call = linux_sys_nosys,
}, /* 308 = filler */

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_systrace_args.c,v 1.9 2017/02/02 15:36:12 christos Exp $ */
/* $NetBSD: linux_systrace_args.c,v 1.10 2017/02/03 16:18:19 christos Exp $ */
/*
* System call argument to DTrace register array converstion.
@ -1770,6 +1770,27 @@ systrace_args(register_t sysnum, const void *params, uintptr_t *uarg, size_t *n_
*n_args = 2;
break;
}
/* linux_sys_recvmmsg */
case 299: {
const struct linux_sys_recvmmsg_args *p = params;
iarg[0] = SCARG(p, s); /* int */
uarg[1] = (intptr_t) SCARG(p, msgvec); /* struct linux_mmsghdr * */
uarg[2] = SCARG(p, vlen); /* unsigned int */
uarg[3] = SCARG(p, flags); /* unsigned int */
uarg[4] = (intptr_t) SCARG(p, timeout); /* struct timespec * */
*n_args = 5;
break;
}
/* linux_sys_sendmmsg */
case 307: {
const struct linux_sys_sendmmsg_args *p = params;
iarg[0] = SCARG(p, s); /* int */
uarg[1] = (intptr_t) SCARG(p, msgvec); /* struct linux_mmsghdr * */
uarg[2] = SCARG(p, vlen); /* unsigned int */
uarg[3] = SCARG(p, flags); /* unsigned int */
*n_args = 4;
break;
}
/* linux_sys_nosys */
case 314: {
*n_args = 0;
@ -4714,6 +4735,47 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
};
break;
/* linux_sys_recvmmsg */
case 299:
switch(ndx) {
case 0:
p = "int";
break;
case 1:
p = "struct linux_mmsghdr *";
break;
case 2:
p = "unsigned int";
break;
case 3:
p = "unsigned int";
break;
case 4:
p = "struct timespec *";
break;
default:
break;
};
break;
/* linux_sys_sendmmsg */
case 307:
switch(ndx) {
case 0:
p = "int";
break;
case 1:
p = "struct linux_mmsghdr *";
break;
case 2:
p = "unsigned int";
break;
case 3:
p = "unsigned int";
break;
default:
break;
};
break;
/* linux_sys_nosys */
case 314:
break;
@ -5740,6 +5802,16 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
if (ndx == 0 || ndx == 1)
p = "int";
break;
/* linux_sys_recvmmsg */
case 299:
if (ndx == 0 || ndx == 1)
p = "int";
break;
/* linux_sys_sendmmsg */
case 307:
if (ndx == 0 || ndx == 1)
p = "int";
break;
/* linux_sys_nosys */
case 314:
default:

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.59 2017/02/02 15:35:46 christos Exp $
$NetBSD: syscalls.master,v 1.60 2017/02/03 16:18:19 christos Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@ -529,7 +529,9 @@
296 UNIMPL pwritev
297 UNIMPL rt_tgsigqueueinfo
298 UNIMPL perf_counter_open
299 UNIMPL recvmmsg
299 STD { int|linux_sys||recvmmsg(int s, \
struct linux_mmsghdr *msgvec, unsigned int vlen, \
unsigned int flags, struct timespec *timeout); }
300 UNIMPL fanotify_init
301 UNIMPL fanotify_mark
302 UNIMPL prlimit64
@ -537,7 +539,9 @@
304 UNIMPL open_by_handle_at
305 UNIMPL clock_adjtime
306 UNIMPL syncfs
307 UNIMPL sendmmsg
307 STD { int|linux_sys||sendmmsg(int s, \
struct linux_mmsghdr *msgvec, unsigned int vlen, \
unsigned int flags); }
308 UNIMPL setns
309 UNIMPL getcpu
310 UNIMPL process_vm_readv