src/dpdk/lib/librte_eal/freebsd/eal_hugepage_info.c
static void *
map_shared_memory(const char *filename, const size_t mem_size, int flags)
{
	void *retval;
	int fd = open(filename, flags, 0600);
	if (fd < 0)
		return NULL;
	if (ftruncate(fd, mem_size) < 0) {
		close(fd);
		return NULL;
	}
	retval = mmap(NULL, mem_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
	close(fd);
	return retval;
}
/*
 * Uses mmap to create a shared memory area for storage of data
 * Used in this file to store the hugepage file map on disk
 */
Uses mmap to create a shared memory area for storage of data
Used in this file to store the hugepage file map on disk
Uses mmap to create a shared memory area for storage of data Used in this file to store the hugepage file map on disk
static void *
map_shared_memory(const char *filename, const size_t mem_size, int flags)
{
	void *retval;
	int fd = open(filename, flags, 0600);
	if (fd < 0)
		return NULL;
	if (ftruncate(fd, mem_size) < 0) {
		close(fd);
		return NULL;
	}
	retval = mmap(NULL, mem_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
	close(fd);
	return retval;
}
static void * map_shared_memory ( const char * filename , const size_t mem_size , int flags ) { void * retval ; int fd = open ( filename , flags , 0600 ) ; if ( fd < 0 ) return NULL ; if ( ftruncate ( fd , mem_size ) < 0 ) { close ( fd ) ; return NULL ; } retval = mmap ( NULL , mem_size , PROT_READ | PROT_WRITE , MAP_SHARED , fd , 0 ) ; close ( fd ) ; return retval ; }
Uses mmap to create a shared memory area for storage of data
 Used in this file to store the hugepage file map on disk
Uses mmap to create a shared memory area for storage of data Used in this file to store the hugepage file map on disk