| 1200 | } |
| 1201 | |
| 1202 | static int |
| 1203 | do_statx (int fd, char const *name, struct stat *st, int flags, |
| 1204 | unsigned int mask) |
| 1205 | { |
| 1206 | struct statx stx; |
| 1207 | bool want_btime = mask & STATX_BTIME; |
| 1208 | int ret = statx (fd, name, flags | AT_NO_AUTOMOUNT, mask, &stx); |
| 1209 | if (ret >= 0) |
| 1210 | { |
| 1211 | statx_to_stat (&stx, st); |
| 1212 | /* Since we only need one timestamp type, |
| 1213 | store birth time in st_mtim. */ |
| 1214 | if (want_btime) |
| 1215 | { |
| 1216 | if (stx.stx_mask & STATX_BTIME) |
| 1217 | st->st_mtim = statx_timestamp_to_timespec (stx.stx_btime); |
| 1218 | else |
| 1219 | st->st_mtim.tv_sec = st->st_mtim.tv_nsec = -1; |
| 1220 | } |
| 1221 | } |
| 1222 | |
| 1223 | return ret; |
| 1224 | } |
| 1225 | |
| 1226 | static int |
| 1227 | do_stat (char const *name, struct stat *st) |
no test coverage detected