| 1247 | } |
| 1248 | |
| 1249 | int |
| 1250 | sys_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 | |
| 1273 | int |
| 1274 | kern_kldstat(struct thread *td, int fileid, struct kld_file_stat *stat) |
nothing calls this directly
no test coverage detected