---
name: "dma_buf_mmap"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/dma_buf_mmap"
---

# dma\_buf\_mmap(9)

Setup up a userspace mmap with the given vma

## NAME

dma\_buf\_mmap - Setup up a userspace mmap with the given vma

## SYNOPSIS

**int dma\_buf\_mmap(struct dma\_buf \*** *dmabuf***, struct vm\_area\_struct \*** *vma***, unsigned long** *pgoff***);**

## ARGUMENTS

*dmabuf*

\[in\] buffer that should back the vma

*vma*

\[in\] vma for the mmap

*pgoff*

\[in\] offset in pages where this mmap should start within the dma-buf buffer.

## DESCRIPTION

This function adjusts the passed in vma so that it points at the file of the dma\_buf operation. It also adjusts the starting pgoff and does bounds checking on the size of the vma. Then it calls the exporters mmap function to set up the mapping.

Can return negative error values, returns 0 on success.

## COPYRIGHT
