coreutils/date.c with FEATURE_DATE_NANO=y broken?
Cristian Ionescu-Idbohrn
cristian.ionescu-idbohrn at axis.com
Sat Jun 5 11:47:54 UTC 2010
I get:
,----
| coreutils/date.c: In function 'date_main':
| coreutils/date.c:207: error: 'struct stat' has no member named 'st_mtimensec'
`----
Looking at the preprocessed code, I note:
,----
| # 88 "/usr/include/bits/stat.h" 3 4
| struct timespec st_atim;
| struct timespec st_mtim;
| struct timespec st_ctim;
| # 109 "/usr/include/bits/stat.h" 3 4
| __ino64_t st_ino;
`----
No trace of 'st_mtimensec', because:
,----[ /usr/include/bits/stat.h ]
| 81 #ifdef __USE_MISC
| 82 /* Nanosecond resolution timestamps are stored in a format
| 83 equivalent to 'struct timespec'. This is the type used
| 84 whenever possible but the Unix namespace rules do not allow the
| 85 identifier 'timespec' to appear in the <sys/stat.h> header.
| 86 Therefore we have to handle the use of this header in strictly
| 87 standard-compliant sources special. */
| 88 struct timespec st_atim; /* Time of last access. */
| 89 struct timespec st_mtim; /* Time of last modification. */
| 90 struct timespec st_ctim; /* Time of last status change. */
| 91 # define st_atime st_atim.tv_sec /* Backward compatibility. */
| 92 # define st_mtime st_mtim.tv_sec
| 93 # define st_ctime st_ctim.tv_sec
| 94 #else
| 95 __time_t st_atime; /* Time of last access. */
| 96 unsigned long int st_atimensec; /* Nscecs of last access. */
| 97 __time_t st_mtime; /* Time of last modification. */
| 98 unsigned long int st_mtimensec; /* Nsecs of last modification. */
| 99 __time_t st_ctime; /* Time of last status change. */
| 100 unsigned long int st_ctimensec; /* Nsecs of last status change. */
| 101 #endif
`----
Cheers,
--
Cristian
More information about the busybox
mailing list