MCPcopy Create free account
hub / github.com/coreutils/coreutils / do_statx

Function do_statx

src/ls.c:1202–1224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1200}
1201
1202static int
1203do_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
1226static int
1227do_stat (char const *name, struct stat *st)

Callers 5

do_statFunction · 0.85
do_lstatFunction · 0.85
stat_for_modeFunction · 0.85
stat_for_inoFunction · 0.85
fstat_for_inoFunction · 0.85

Calls 3

statx_to_statFunction · 0.85
statxClass · 0.70

Tested by

no test coverage detected