* Determine if the credentials have sufficient permissions for read * and write access. */
| 357 | * and write access. |
| 358 | */ |
| 359 | static int |
| 360 | ksem_access(struct ksem *ks, struct ucred *ucred) |
| 361 | { |
| 362 | int error; |
| 363 | |
| 364 | error = vaccess(VREG, ks->ks_mode, ks->ks_uid, ks->ks_gid, |
| 365 | VREAD | VWRITE, ucred); |
| 366 | if (error) |
| 367 | error = priv_check_cred(ucred, PRIV_SEM_WRITE); |
| 368 | return (error); |
| 369 | } |
| 370 | |
| 371 | /* |
| 372 | * Dictionary management. We maintain an in-kernel dictionary to map |
no test coverage detected