GSoC 2017 introduction

Victor Krapivensky krapivenskiy.va at phystech.edu
Fri Mar 10 18:59:19 UTC 2017


On 03/10/2017 04:36 AM, Dmitry V. Levin wrote:

> This cannot be correct.

OK, removed it for now, and fixed all the issues you mentioned. I've
also added a test, so please review.

I've also stumbled upon a wrong comment in util.c. Attaching a separate
patch for it.

> This is wrong, the type of nsec is int32_t.  I have no idea why it is
> defined as signed, I see no reason for that.  Anyway, you shouldn't just
> print an absolute value, it wouldn't be correct.
OK, I have slightly misinterpreted the kernel documentation for struct
statx_timestamp [1], but the fact is, kernel behaviour differs from what
is stated there:
> /*
>  * Timestamp structure for the timestamps in struct statx.
>  *
>  * tv_sec holds the number of seconds before (negative) or after 
> (positive)
>  * 00:00:00 1st January 1970 UTC.
>  *
>  * tv_nsec holds a number of nanoseconds before (0..-999,999,999 if 
> tv_sec is
>  * negative) or after (0..999,999,999 if tv_sec is positive) the 
> tv_sec time.
>  *
>  * Note that if both tv_sec and tv_nsec are non-zero, then the two 
> values must
>  * either be both positive or both negative.

But if I do

$ touch --date=@-123456789.3 dinosaur

and then call statx on dinosaur, I get negative stx_atime.tv_sec
(-123456790) and positive stx_atime.tv_nsec (700000000).

> I suggest printing it using %09u format.

Yes, the samples/statx/test-statx.c program shipped with the kernel does
exactly that. I've changed it to "%09" PRId32, just in case it happens
to be negative.

[1] 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/stat.h#n45
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v3-0001-Add-support-for-statx-syscall.patch
Type: text/x-diff
Size: 16778 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170310/1d3aab64/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v1-0001-util.c-remove-a-wrong-comment.patch
Type: text/x-diff
Size: 723 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170310/1d3aab64/attachment-0001.bin>


More information about the Strace-devel mailing list