RFC userfaultfd ioctl decode

Dmitry V. Levin ldv at altlinux.org
Thu Apr 21 23:44:09 UTC 2016


On Thu, Apr 21, 2016 at 06:27:13PM +0200, Gabriel Laskar wrote:
> On Thu, 21 Apr 2016 14:04:33 +0100
> "Dr. David Alan Gilbert" <dgilbert at redhat.com> wrote:
> 
> > Hi,
> >    Please find below a decoder for the UFFDIO_COPY ioctl
> > on the userfaultfd fd;  but there are a few other ioctls
> > in the set to decode and I thought I'd ask before doing those:
> > 
> >   1) Is it basically on the right lines;  I'm not that confident
> >      I understand the return flags on the ioctl decoder function.
> 
> The return flags are the same as for the syscalls in general, it is
> written in defs.h around line 378. It allows to type the return value
> if it is not an int.
> 
> For the ioctl decoding function, on entering there is:
> 
> * 0 if nothing has been decoded, (and it will be probably done on
>   exiting())
> * 1 parameter have been parsed, and printed
> * RVAL_DECODED if there is nothing else to do.
> * 1 | RVAL_DECODED : parameter have been parsed, but there is some kind
>   of error/nothing has been printed, so this allow the ioctl decoder to
>   write a default value.
> 
> and on exiting, there is only 0 or 1.

You can find the result of my attempt to explain this semantics
in the mailing list archive, e.g. at
https://sourceforge.net/p/strace/mailman/message/34451172/


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


More information about the Strace-devel mailing list