| 1328 | #endif /* DDB */ |
| 1329 | |
| 1330 | int |
| 1331 | sys_kldfirstmod(struct thread *td, struct kldfirstmod_args *uap) |
| 1332 | { |
| 1333 | linker_file_t lf; |
| 1334 | module_t mp; |
| 1335 | int error = 0; |
| 1336 | |
| 1337 | #ifdef MAC |
| 1338 | error = mac_kld_check_stat(td->td_ucred); |
| 1339 | if (error) |
| 1340 | return (error); |
| 1341 | #endif |
| 1342 | |
| 1343 | sx_xlock(&kld_sx); |
| 1344 | lf = linker_find_file_by_id(uap->fileid); |
| 1345 | if (lf) { |
| 1346 | MOD_SLOCK; |
| 1347 | mp = TAILQ_FIRST(&lf->modules); |
| 1348 | if (mp != NULL) |
| 1349 | td->td_retval[0] = module_getid(mp); |
| 1350 | else |
| 1351 | td->td_retval[0] = 0; |
| 1352 | MOD_SUNLOCK; |
| 1353 | } else |
| 1354 | error = ENOENT; |
| 1355 | sx_xunlock(&kld_sx); |
| 1356 | return (error); |
| 1357 | } |
| 1358 | |
| 1359 | int |
| 1360 | sys_kldsym(struct thread *td, struct kldsym_args *uap) |
nothing calls this directly
no test coverage detected