FreeBSD/sys/kern/uipc_sem.c
/*
 * Dictionary management.  We maintain an in-kernel dictionary to map
 * paths to semaphore objects.  We use the FNV hash on the path to
 * store the mappings in a hash table.
 */
Dictionary management.  We maintain an in-kernel dictionary to map
paths to semaphore objects.  We use the FNV hash on the path to
store the mappings in a hash table.
Dictionary management . We maintain an in - kernel dictionary to map paths to semaphore objects . We use the FNV hash on the path to store the mappings in a hash table .
static struct ksem *
ksem_lookup(char *path, Fnv32_t fnv)
{
	struct ksem_mapping *map;
	LIST_FOREACH(map, KSEM_HASH(fnv), km_link) {
		if (map->km_fnv != fnv)
			continue;
		if (strcmp(map->km_path, path) == 0)
			return (map->km_ksem);
	}
	return (NULL);
}
static struct ksem * ksem_lookup ( char * path , Fnv32_t fnv ) { struct ksem_mapping * map ; LIST_FOREACH ( map , KSEM_HASH ( fnv ) , km_link ) { if ( map -> km_fnv != fnv ) continue ; if ( strcmp ( map -> km_path , path ) == 0 ) return ( map -> km_ksem ) ; } return ( NULL ) ; }
Dictionary management.
Dictionary management .