[PATCH v7] Implement decoding of statx syscall
Dmitry V. Levin
ldv at altlinux.org
Sat Mar 18 11:28:16 UTC 2017
On Sat, Mar 18, 2017 at 01:10:33PM +0300, Victor Krapivensky wrote:
> On Sat, Mar 18, 2017 at 04:00:50AM +0300, Dmitry V. Levin wrote:
> > I suggest placing AT_STATX_SYNC_TYPE before AT_STATX_FORCE_SYNC
> > so we could use printflags.
>
> I don't see any sense in that:
> AT_STATX_{SYNC_AS_STAT,FORCE_SYNC,DONT_SYNC} are mutually exclusive, and
> statx called with flags=AT_STATX_SYNC_TYPE (aka
> AT_STATX_FORCE_SYNC|AT_STATX_DONT_SYNC) fails with EINVAL.
>
> I think it would be more appropriate to print
> "AT_STATX_FORCE_SYNC|AT_STATX_DONT_SYNC" it that case, so that one can
> clearly see that the flags passed are self-contradictory.
The kernel does this check:
if ((flags & AT_STATX_SYNC_TYPE) == AT_STATX_SYNC_TYPE)
return -EINVAL;
That is, if strace printed AT_STATX_SYNC_TYPE, it would be OK.
I agree that AT_STATX_FORCE_SYNC|AT_STATX_DONT_SYNC is somewhat more
obvious than AT_STATX_SYNC_TYPE, so if strace printed the longer
presentation of flags, it also would be OK.
Now it's your parser and your choice.
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170318/02c58e4b/attachment.bin>
More information about the Strace-devel
mailing list