st_* variables of ctim vs ctime vs ctimespec; is there a history & recommended use?
Date: Sun, 01 Oct 2023 01:50:29 UTC
After recently finding stat(1) EXAMPLES error (I filed under PR274189 with patch and reasoning), I was trying to learn the meanings of these variables which lead me through reading stat(2) (found by `man lstat`) which says it uses st_mtim and provides both st_mtime and st_mtimespec for compatibility. I didn't find any listed reason for the compatibility otherwise and wondered if that is documented somewhere. Is there a recommended 'choice' for compatibility that users should know to use for code portability or is that documented somewhere else inside/outside the FreeBSD project that you can point me to? I also presume that 'compatibility' should be clarified in our copies of the NetBSD program's documentation unless the two projects use the same variables. Does stat(1) use of st_mtime stat(2) saying st_mtim have connection to causing more of these variants or does it use the variant due to being a tool pulled in from NetBSD or was it a decision of separating programmers and users interfaces with the system? My apologies if I should have sent this to a different mailing list but I have not seen one with a programming focus and this topic seemed mixed as it began by my reading up on /bin/stat to use the tool in userland. Thank you, Edward Sanford Sutton, III