[PATCH 1/2] Replace x86-64 paccept with accept4

Dmitry V. Levin ldv at altlinux.org
Mon Aug 17 13:06:20 UTC 2009


Hi,

On Fri, Aug 14, 2009 at 12:34:05PM +0200, Paolo Bonzini wrote:
> This patch changes the paccept syscall to accept4 for x86-64, since
> the former was dropped in Linux kernel commit 2d4c8266.
> 
> At the same time, it adds support for pretty-printing its arguments.

The pretty printing part of the change is incomplete, it misses
the case when 3rd arg is NULL.  Please consider a fix appended below.
All the rest looks OK for me.

--- a/net.c
+++ b/net.c
@@ -1308,7 +1308,9 @@ 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;
@@ -1320,11 +1322,11 @@ do_accept(struct tcb *tcp, int flags_arg)
 		}
 		tprintf(", ");
 		printnum_int(tcp, tcp->u_arg[2], "%u");
-		if (flags_arg >= 0) {
-			tprintf(", ");
-			printflags(sock_type_flags, tcp->u_arg[flags_arg],
-				   "SOCK_???");
-		}
+	}
+	if (flags_arg >= 0) {
+		tprintf(", ");
+		printflags(sock_type_flags, tcp->u_arg[flags_arg],
+			   "SOCK_???");
 	}
 	return 0;
 }


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20090817/72f04e11/attachment.bin>


More information about the Strace-devel mailing list