This kept me busy for a while, trying to find the right interface. At
the end I studied Python interpreter source code.

"man -s2 stat" shows this: (current revision is October 10, 2007)

"""
         time_t   st_atime;         /* Time of last access */
         time_t   st_mtime;         /* Time of last data modification */
         time_t   st_ctime;         /* Time of last file status change */
                                    /* Times measured in seconds since */
                                    /* 00:00:00 UTC, Jan. 1, 1970 */

"""

According to this, precision is limited to 1 second.

Reality is nicer. In "/usr/include/sys/stat.h" we have several
definitions of the structure, but this is common:

"""
        timestruc_t     st_atim;
        timestruc_t     st_mtim;
        timestruc_t     st_ctim;
...
#define st_atime        st_atim.tv_sec
#define st_mtime        st_mtim.tv_sec
#define st_ctime        st_ctim.tv_sec
"""

So the fields are actually timestruct_t structs with nanosecond
precision and "st_*time" are just macros to get the second field.

Linux does the same, but it is explicit in the man page. "man 2 stat":

"""
               /* Since Linux 2.6, the kernel supports nanosecond
                  precision for the following timestamp fields.
                  For the details before Linux 2.6, see NOTES. */

               struct timespec st_atim;  /* time of last access */
               struct timespec st_mtim;  /* time of last modification */
               struct timespec st_ctim;  /* time of last status change */

           #define st_atime st_atim.tv_sec      /* Backward compatibility */
           #define st_mtime st_mtim.tv_sec
           #define st_ctime st_ctim.tv_sec
"""

what would be the right approach to request a man page update?. I guess
this should be pushed thru Illumos, but I don't know the details.

Somebody with the knowledge and the access could sponsor this to Illumos?.

Thanks!!!.

-- 
Jesús Cea Avión                         _/_/      _/_/_/        _/_/_/
[email protected] - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
Twitter: @jcea                        _/_/    _/_/          _/_/_/_/_/
jabber / xmpp:[email protected]  _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz

Attachment: signature.asc
Description: OpenPGP digital signature




-------------------------------------------
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com

Reply via email to