MCPcopy Create free account
hub / github.com/F-Stack/f-stack / kern_fstat

Function kern_fstat

freebsd/kern/kern_descrip.c:1530–1557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1528}
1529
1530int
1531kern_fstat(struct thread *td, int fd, struct stat *sbp)
1532{
1533 struct file *fp;
1534 int error;
1535
1536 AUDIT_ARG_FD(fd);
1537
1538 error = fget(td, fd, &cap_fstat_rights, &fp);
1539 if (__predict_false(error != 0))
1540 return (error);
1541
1542 AUDIT_ARG_FILE(td->td_proc, fp);
1543
1544 error = fo_stat(fp, sbp, td->td_ucred, td);
1545 fdrop(fp, td);
1546#ifdef __STAT_TIME_T_EXT
1547 sbp->st_atim_ext = 0;
1548 sbp->st_mtim_ext = 0;
1549 sbp->st_ctim_ext = 0;
1550 sbp->st_btim_ext = 0;
1551#endif
1552#ifdef KTRACE
1553 if (KTRPOINT(td, KTR_STRUCT))
1554 ktrstat_error(sbp, error);
1555#endif
1556 return (error);
1557}
1558
1559#if defined(COMPAT_FREEBSD11)
1560/*

Callers 4

ofstatFunction · 0.85
freebsd11_fstatFunction · 0.85
sys_fstatFunction · 0.85
freebsd11_nfstatFunction · 0.85

Calls 2

fgetFunction · 0.85
fo_statFunction · 0.85

Tested by

no test coverage detected