Re: Typo in stat(2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/30/20 2:22 PM, Florian Weimer wrote:
> * Christoph Kalchreuter:
> 
>> There are three Letters "e" missing in Section "DESCRIPTION",
>> Subsection "The stat structure":
>>
>> struct timespec st_atim;  /* Time of last access */
>> struct timespec st_mtim;  /* Time of last modification */
>> sruct timespec st_ctim;  /* Time of last status change */
>>
>> should possibly be:
>>
>> struct timespec st_atime;  /* Time of last access */
>> struct timespec st_mtime;  /* Time of last modification */
>> sruct timespec st_ctime;  /* Time of last status change */
> 
> This typo is also present in POSIX, so we cannot change it (like the
> creat function).

Hi Christoph,

Florian was being very deadpan in his humor! The names 
really are correct. In the header files, one can find

[[  # /usr/include/bits/stat.h

    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
]]

And struct timespec is defined as

              struct timespec {
                  time_t  tv_sec;  /* Seconds */
                  long    tv_nsec; /* Nanoseconds */
              };


Thanks,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux