[PATCH] Decode recvmmsg syscall

Dmitry V. Levin ldv at altlinux.org
Mon Mar 29 16:14:36 UTC 2010


On Sat, Feb 13, 2010 at 12:28:26AM +0300, Dmitry V. Levin wrote:
> On Fri, Feb 12, 2010 at 09:39:12PM +0100, Andreas Schwab wrote:
> [...]
> > +int
> > +sys_recvmmsg(struct tcb *tcp)
> > +{
> > +	if (entering(tcp)) {
> > +		tprintf("%ld, ", tcp->u_arg[0]);
> > +		printmmsghdr(tcp, tcp->u_arg[1]);
> > +		tprintf(", %ld, ", tcp->u_arg[2]);
> > +		/* flags */
> > +		printflags(msg_flags, tcp->u_arg[3], "MSG_???");
> > +		/* timeout */
> > +		tprintf(", ");
> > +		print_timespec(tcp, tcp->u_arg[4]);
> > +	}
> > +	return 0;
> > +}
> 
> If recvmmsg semantics is similar to recvmsg, then only file descriptor
> can be decoded on entrance to the syscall, while the mmsghdr structure
> (and all the rest) -- on exit from the syscall.

It appeared to be even more complicated because tcp->u_arg[4] should be
decoded twice like in sys_ppoll, but tcp->u_arg[1] can be decoded only
on exit.
One possible solution is to abuse tcp->auxstr by storing the timespec
decoded on entrance, then print this stored value on exit and replace it
with the timespec decoded on exit.
Another solution is to print as much as possible on entrance, and to
place in tcp->auxstr the result of mmsghdr and timespec decoded on exit.
Which one do you prefer?


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


More information about the Strace-devel mailing list