Skip to content

Commit e3ec796

Browse files
committed
Merge branch 'jc/doc-timestamps-in-stat' into jch
Doc update. * jc/doc-timestamps-in-stat: CodingGuidelines: st_mtimespec vs st_mtim vs st_mtime
2 parents e642fdc + e256d21 commit e3ec796

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Documentation/CodingGuidelines

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,12 @@ For C programs:
693693
char *dogs[] = ...;
694694
walk_all_dogs(dogs);
695695

696+
- For file timestamps, do not use "st_mtim" (and other timestamp
697+
members in "struct stat") unconditionally; not everybody is POSIX
698+
(grep for USE_ST_TIMESPEC). If you only need timestamp in whole
699+
second resolution, "st_mtime" should work fine everywhere.
700+
701+
696702
For Perl programs:
697703

698704
- Most of the C guidelines above apply.

0 commit comments

Comments
 (0)