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

Function shm_access

freebsd/kern/uipc_shm.c:915–931  ·  view source on GitHub ↗

* Determine if the credentials have sufficient permissions for a * specified combination of FREAD and FWRITE. */

Source from the content-addressed store, hash-verified

913 * specified combination of FREAD and FWRITE.
914 */
915int
916shm_access(struct shmfd *shmfd, struct ucred *ucred, int flags)
917{
918 accmode_t accmode;
919 int error;
920
921 accmode = 0;
922 if (flags & FREAD)
923 accmode |= VREAD;
924 if (flags & FWRITE)
925 accmode |= VWRITE;
926 mtx_lock(&shm_timestamp_lock);
927 error = vaccess(VREG, shmfd->shm_mode, shmfd->shm_uid, shmfd->shm_gid,
928 accmode, ucred);
929 mtx_unlock(&shm_timestamp_lock);
930 return (error);
931}
932
933static void
934shm_init(void *arg)

Callers 3

kern_umtx.cFile · 0.85
shm_removeFunction · 0.85
kern_shm_open2Function · 0.85

Calls 3

vaccessFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected