FreeBSD/sys/kern/uipc_shm.c
/*
 * Determine if the credentials have sufficient permissions for a
 * specified combination of FREAD and FWRITE.
 */
Determine if the credentials have sufficient permissions for a
specified combination of FREAD and FWRITE.
Determine if the credentials have sufficient permissions for a specified combination of FREAD and FWRITE .
int
shm_access(struct shmfd *shmfd, struct ucred *ucred, int flags)
{
	accmode_t accmode;
	int error;
	accmode = 0;
	if (flags & FREAD)
		accmode |= VREAD;
	if (flags & FWRITE)
		accmode |= VWRITE;
	mtx_lock(&shm_timestamp_lock);
	error = vaccess(VREG, shmfd->shm_mode, shmfd->shm_uid, shmfd->shm_gid,
	    accmode, ucred, NULL);
	mtx_unlock(&shm_timestamp_lock);
	return (error);
}
int shm_access ( struct shmfd * shmfd , struct ucred * ucred , int flags ) { accmode_t accmode ; int error ; accmode = 0 ; if ( flags & FREAD ) accmode |= VREAD ; if ( flags & FWRITE ) accmode |= VWRITE ; mtx_lock ( & shm_timestamp_lock ) ; error = vaccess ( VREG , shmfd -> shm_mode , shmfd -> shm_uid , shmfd -> shm_gid , accmode , ucred , NULL ) ; mtx_unlock ( & shm_timestamp_lock ) ; return ( error ) ; }
Determine if the credentials have sufficient permissions for a
 specified combination of FREAD and FWRITE.
Determine if the credentials have sufficient permissions for a specified combination of FREAD and FWRITE .