Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions sys/compat/linux/arch/amd64/linux_syscall.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* $NetBSD: linux_syscall.h,v 1.87 2025/11/10 15:41:57 christos Exp $ */
/* $NetBSD$ */

/*
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
* DO NOT EDIT-- this file is generated by makesyscalls.sh
* created from NetBSD: syscalls.master,v 1.78 2025/11/10 15:41:38 christos Exp
*/

Expand Down Expand Up @@ -135,6 +135,9 @@
/* syscall: "getpid" ret: "pid_t" args: */
#define LINUX_SYS_getpid 39

/* syscall: "sendfile" ret: "ssize_t" args: "int" "int" "off_t *" "size_t" */
#define LINUX_SYS_sendfile 40

/* syscall: "socket" ret: "int" args: "int" "int" "int" */
#define LINUX_SYS_socket 41

Expand Down
14 changes: 12 additions & 2 deletions sys/compat/linux/arch/amd64/linux_syscallargs.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* $NetBSD: linux_syscallargs.h,v 1.87 2025/11/10 15:41:57 christos Exp $ */
/* $NetBSD$ */

/*
* System call argument lists.
*
* DO NOT EDIT-- this file is automatically generated.
* DO NOT EDIT-- this file is generated by makesyscalls.sh
* created from NetBSD: syscalls.master,v 1.78 2025/11/10 15:41:38 christos Exp
*/

Expand Down Expand Up @@ -186,6 +186,14 @@ check_syscall_args(linux_sys_alarm)

struct compat_50_sys_setitimer_args;

struct linux_sys_sendfile_args {
syscallarg(int) out_fd;
syscallarg(int) in_fd;
syscallarg(off_t *) offset;
syscallarg(size_t) count;
};
check_syscall_args(linux_sys_sendfile)

struct linux_sys_socket_args {
syscallarg(int) domain;
syscallarg(int) type;
Expand Down Expand Up @@ -1425,6 +1433,8 @@ int compat_50_sys_setitimer(struct lwp *, const struct compat_50_sys_setitimer_a

int sys_getpid(struct lwp *, const void *, register_t *);

int linux_sys_sendfile(struct lwp *, const struct linux_sys_sendfile_args *, register_t *);

int linux_sys_socket(struct lwp *, const struct linux_sys_socket_args *, register_t *);

int linux_sys_connect(struct lwp *, const struct linux_sys_connect_args *, register_t *);
Expand Down
10 changes: 5 additions & 5 deletions sys/compat/linux/arch/amd64/linux_syscalls.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* $NetBSD: linux_syscalls.c,v 1.87 2025/11/10 15:41:57 christos Exp $ */
/* $NetBSD$ */

/*
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
* DO NOT EDIT-- this file is generated by makesyscalls.sh
* created from NetBSD: syscalls.master,v 1.78 2025/11/10 15:41:38 christos Exp
*/

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.87 2025/11/10 15:41:57 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD$");

#if defined(_KERNEL_OPT)
#if defined(_KERNEL_OPT)
Expand Down Expand Up @@ -89,7 +89,7 @@ const char *const linux_syscallnames[] = {
/* 37 */ "alarm",
/* 38 */ "setitimer",
/* 39 */ "getpid",
/* 40 */ "#40 (unimplemented sendfile)",
/* 40 */ "sendfile",
/* 41 */ "socket",
/* 42 */ "connect",
/* 43 */ "oaccept",
Expand Down Expand Up @@ -633,7 +633,7 @@ const char *const altlinux_syscallnames[] = {
/* 37 */ NULL, /* alarm */
/* 38 */ NULL, /* setitimer */
/* 39 */ NULL, /* getpid */
/* 40 */ NULL, /* unimplemented sendfile */
/* 40 */ NULL, /* sendfile */
/* 41 */ NULL, /* socket */
/* 42 */ NULL, /* connect */
/* 43 */ "accept",
Expand Down
12 changes: 7 additions & 5 deletions sys/compat/linux/arch/amd64/linux_sysent.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* $NetBSD: linux_sysent.c,v 1.87 2025/11/10 15:41:57 christos Exp $ */
/* $NetBSD$ */

/*
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
* DO NOT EDIT-- this file is generated by makesyscalls.sh
* created from NetBSD: syscalls.master,v 1.78 2025/11/10 15:41:38 christos Exp
*/

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.87 2025/11/10 15:41:57 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD$");

#if defined(_KERNEL_OPT)
#include "opt_sysv.h"
Expand Down Expand Up @@ -241,8 +241,10 @@ struct sysent linux_sysent[] = {
.sy_call = (sy_call_t *)sys_getpid
}, /* 39 = getpid */
{
.sy_call = linux_sys_nosys,
}, /* 40 = filler */
ns(struct linux_sys_sendfile_args),
.sy_flags = SYCALL_ARG_PTR,
.sy_call = (sy_call_t *)linux_sys_sendfile
}, /* 40 = sendfile */
{
ns(struct linux_sys_socket_args),
.sy_call = (sy_call_t *)linux_sys_socket
Expand Down
38 changes: 36 additions & 2 deletions sys/compat/linux/arch/amd64/linux_systrace_args.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* $NetBSD: linux_systrace_args.c,v 1.31 2025/11/10 15:41:57 christos Exp $ */
/* $NetBSD$ */

/*
* System call argument to DTrace register array conversion.
*
* DO NOT EDIT-- this file is automatically generated.
* DO NOT EDIT-- this file is generated by makesyscalls.sh
* This file is part of the DTrace syscall provider.
*/

Expand Down Expand Up @@ -351,6 +351,16 @@ systrace_args(register_t sysnum, const void *params, uintptr_t *uarg, size_t *n_
*n_args = 0;
break;
}
/* linux_sys_sendfile */
case 40: {
const struct linux_sys_sendfile_args *p = params;
iarg[0] = SCARG(p, out_fd); /* int */
iarg[1] = SCARG(p, in_fd); /* int */
uarg[2] = (intptr_t) SCARG(p, offset); /* off_t * */
uarg[3] = SCARG(p, count); /* size_t */
*n_args = 4;
break;
}
/* linux_sys_socket */
case 41: {
const struct linux_sys_socket_args *p = params;
Expand Down Expand Up @@ -2780,6 +2790,25 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
/* sys_getpid */
case 39:
break;
/* linux_sys_sendfile */
case 40:
switch(ndx) {
case 0:
p = "int";
break;
case 1:
p = "int";
break;
case 2:
p = "off_t *";
break;
case 3:
p = "size_t";
break;
default:
break;
};
break;
/* linux_sys_socket */
case 41:
switch(ndx) {
Expand Down Expand Up @@ -6113,6 +6142,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* sys_getpid */
case 39:
/* linux_sys_sendfile */
case 40:
if (ndx == 0 || ndx == 1)
p = "ssize_t";
break;
/* linux_sys_socket */
case 41:
if (ndx == 0 || ndx == 1)
Expand Down
3 changes: 2 additions & 1 deletion sys/compat/linux/arch/amd64/syscalls.master
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
struct itimerval50 *itv, \
struct itimerval50 *oitv); }
39 STD { pid_t|sys||getpid(void); }
40 UNIMPL sendfile
40 STD { ssize_t|linux_sys||sendfile(int out_fd, int in_fd, \
off_t *offset, size_t count); }
41 STD { int|linux_sys||socket(int domain, \
int type, int protocol); }
42 STD { int|linux_sys||connect(int s, \
Expand Down
Loading