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

Function sys_kldstat

freebsd/kern/kern_linker.c:1249–1271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1247}
1248
1249int
1250sys_kldstat(struct thread *td, struct kldstat_args *uap)
1251{
1252 struct kld_file_stat *stat;
1253 int error, version;
1254
1255 /*
1256 * Check the version of the user's structure.
1257 */
1258 if ((error = copyin(&uap->stat->version, &version, sizeof(version)))
1259 != 0)
1260 return (error);
1261 if (version != sizeof(struct kld_file_stat_1) &&
1262 version != sizeof(struct kld_file_stat))
1263 return (EINVAL);
1264
1265 stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO);
1266 error = kern_kldstat(td, uap->fileid, stat);
1267 if (error == 0)
1268 error = copyout(stat, uap->stat, version);
1269 free(stat, M_TEMP);
1270 return (error);
1271}
1272
1273int
1274kern_kldstat(struct thread *td, int fileid, struct kld_file_stat *stat)

Callers

nothing calls this directly

Calls 5

mallocFunction · 0.85
kern_kldstatFunction · 0.85
freeFunction · 0.70
copyinFunction · 0.50
copyoutFunction · 0.50

Tested by

no test coverage detected