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

Function ksem_chmod

freebsd/kern/uipc_sem.c:199–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199static int
200ksem_chmod(struct file *fp, mode_t mode, struct ucred *active_cred,
201 struct thread *td)
202{
203 struct ksem *ks;
204 int error;
205
206 error = 0;
207 ks = fp->f_data;
208 mtx_lock(&sem_lock);
209#ifdef MAC
210 error = mac_posixsem_check_setmode(active_cred, ks, mode);
211 if (error != 0)
212 goto out;
213#endif
214 error = vaccess(VREG, ks->ks_mode, ks->ks_uid, ks->ks_gid, VADMIN,
215 active_cred);
216 if (error != 0)
217 goto out;
218 ks->ks_mode = mode & ACCESSPERMS;
219out:
220 mtx_unlock(&sem_lock);
221 return (error);
222}
223
224static int
225ksem_chown(struct file *fp, uid_t uid, gid_t gid, struct ucred *active_cred,

Callers

nothing calls this directly

Calls 4

vaccessFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected