]>
git.proxmox.com Git - ceph.git/blob - ceph/src/include/stat.h
9 * Access time-related `struct stat` members.
11 * Note that for each of the stat member get/set functions below, setting a
12 * high-res value (stat_set_*_nsec) on a platform without high-res support is
16 #ifdef HAVE_STAT_ST_MTIM_TV_NSEC
18 static inline uint32_t stat_get_mtime_nsec(struct stat
*st
)
20 return st
->st_mtim
.tv_nsec
;
23 static inline void stat_set_mtime_nsec(struct stat
*st
, uint32_t nsec
)
25 st
->st_mtim
.tv_nsec
= nsec
;
28 static inline uint32_t stat_get_atime_nsec(struct stat
*st
)
30 return st
->st_atim
.tv_nsec
;
33 static inline void stat_set_atime_nsec(struct stat
*st
, uint32_t nsec
)
35 st
->st_atim
.tv_nsec
= nsec
;
38 static inline uint32_t stat_get_ctime_nsec(struct stat
*st
)
40 return st
->st_ctim
.tv_nsec
;
43 static inline void stat_set_ctime_nsec(struct stat
*st
, uint32_t nsec
)
45 st
->st_ctim
.tv_nsec
= nsec
;
48 #elif defined(HAVE_STAT_ST_MTIMESPEC_TV_NSEC)
50 static inline uint32_t stat_get_mtime_nsec(struct stat
*st
)
52 return st
->st_mtimespec
.tv_nsec
;
55 static inline void stat_set_mtime_nsec(struct stat
*st
, uint32_t nsec
)
57 st
->st_mtimespec
.tv_nsec
= nsec
;
60 static inline uint32_t stat_get_atime_nsec(struct stat
*st
)
62 return st
->st_atimespec
.tv_nsec
;
65 static inline void stat_set_atime_nsec(struct stat
*st
, uint32_t nsec
)
67 st
->st_atimespec
.tv_nsec
= nsec
;
70 static inline uint32_t stat_get_ctime_nsec(struct stat
*st
)
72 return st
->st_ctimespec
.tv_nsec
;
75 static inline void stat_set_ctime_nsec(struct stat
*st
, uint32_t nsec
)
77 st
->st_ctimespec
.tv_nsec
= nsec
;
82 static inline uint32_t stat_get_mtime_nsec(struct stat
*st
)
87 static inline void stat_set_mtime_nsec(struct stat
*st
, uint32_t nsec
)
91 static inline uint32_t stat_get_atime_nsec(struct stat
*st
)
96 static inline void stat_set_atime_nsec(struct stat
*st
, uint32_t nsec
)
100 static inline uint32_t stat_get_ctime_nsec(struct stat
*st
)
105 static inline void stat_set_ctime_nsec(struct stat
*st
, uint32_t nsec
)
112 * Access second-resolution `struct stat` members.
115 static inline uint32_t stat_get_mtime_sec(struct stat
*st
)
120 static inline void stat_set_mtime_sec(struct stat
*st
, uint32_t sec
)
125 static inline uint32_t stat_get_atime_sec(struct stat
*st
)
130 static inline void stat_set_atime_sec(struct stat
*st
, uint32_t sec
)
135 static inline uint32_t stat_get_ctime_sec(struct stat
*st
)
140 static inline void stat_set_ctime_sec(struct stat
*st
, uint32_t sec
)