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
pgpCX7WqGXtgA.pgp
Description: PGP signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Strace-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/strace-devel
