sys/stat.h: Improve timespec compatibility with other BSDs
OpenBSD and NetBSD provide macros to directly reference the underlying struct timespec's tv_nsec member. While FreeBSD has such macros for tv_sec, the others are missing. Add the following macros: st->st_atimensec st->st_mtimensec st->st_ctimensec st->st_birthtimensec Adding these fields will provide programs which reference them better portability to FreeBSD. An example of such a program is makefs(8), which has unused support for subseconds that it has inherited from NetBSD. Submitted by: Mitchell Horne <mhorne063@gmail.com> Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D19626
This commit is contained in:
parent
fdfe051110
commit
c6b6ed2e54
@ -224,6 +224,10 @@ struct nstat {
|
||||
#define st_ctime st_ctim.tv_sec
|
||||
#if __BSD_VISIBLE
|
||||
#define st_birthtime st_birthtim.tv_sec
|
||||
#define st_atimensec st_atim.tv_nsec
|
||||
#define st_mtimensec st_mtim.tv_nsec
|
||||
#define st_ctimensec st_ctim.tv_nsec
|
||||
#define st_birthtimensec st_birthtim.tv_nsec
|
||||
#endif
|
||||
|
||||
/* For compatibility. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user