Replace x86-64 paccept with accept4

This patch changes the paccept syscall to accept4 for x86-64, since
the former was dropped in Linux kernel commit v2.6.27-rc7-14-g2d4c826.
At the same time, it adds support for pretty printing its arguments.

* linux/x86_64/syscallent.h: Replace paccept with accept4,
hook in sys_accept4.
* net.c (sys_accept): Leave a small stub calling the new...
(do_accept): ... function, which also adds a flags_arg argument.
(sys_accept4): New.
This commit is contained in:
Paolo Bonzini
2009-08-14 12:34:05 +02:00
committed by Dmitry V. Levin
parent 99c85693a5
commit 705ff10c0b
3 changed files with 26 additions and 6 deletions

28
net.c
View File

@@ -1303,13 +1303,14 @@ struct tcb *tcp;
return 0;
}
int
sys_accept(tcp)
struct tcb *tcp;
static int
do_accept(struct tcb *tcp, int flags_arg)
{
if (entering(tcp)) {
tprintf("%ld, ", tcp->u_arg[0]);
} else if (!tcp->u_arg[2])
return 0;
}
if (!tcp->u_arg[2])
tprintf("%#lx, NULL", tcp->u_arg[1]);
else {
int len;
@@ -1322,9 +1323,28 @@ struct tcb *tcp;
tprintf(", ");
printnum_int(tcp, tcp->u_arg[2], "%u");
}
if (flags_arg >= 0) {
tprintf(", ");
printflags(sock_type_flags, tcp->u_arg[flags_arg],
"SOCK_???");
}
return 0;
}
int
sys_accept(struct tcb *tcp)
{
return do_accept(tcp, -1);
}
#ifdef LINUX
int
sys_accept4(struct tcb *tcp)
{
return do_accept(tcp, 3);
}
#endif
int
sys_send(tcp)
struct tcb *tcp;