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

Function ksem_get

freebsd/kern/uipc_sem.c:591–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589}
590
591static int
592ksem_get(struct thread *td, semid_t id, cap_rights_t *rightsp,
593 struct file **fpp)
594{
595 struct ksem *ks;
596 struct file *fp;
597 int error;
598
599 error = fget(td, id, rightsp, &fp);
600 if (error)
601 return (EINVAL);
602 if (fp->f_type != DTYPE_SEM) {
603 fdrop(fp, td);
604 return (EINVAL);
605 }
606 ks = fp->f_data;
607 if (ks->ks_flags & KS_DEAD) {
608 fdrop(fp, td);
609 return (EINVAL);
610 }
611 *fpp = fp;
612 return (0);
613}
614
615/* System calls. */
616#ifndef _SYS_SYSPROTO_H_

Callers 5

sys_ksem_closeFunction · 0.85
sys_ksem_postFunction · 0.85
kern_sem_waitFunction · 0.85
sys_ksem_getvalueFunction · 0.85
sys_ksem_destroyFunction · 0.85

Calls 1

fgetFunction · 0.85

Tested by

no test coverage detected