mmap on freebsd vs linux

usleepless at gmail.com usleepless at gmail.com
Wed Apr 18 16:05:46 UTC 2007


Hi All,

i am looking into implementing a piece of the V4L interface. this
involves mmap'ing from userspace into kernelspace.

in mplayer, this is what is called:

tvi_v4l2.c:
"
priv->map[i].addr = mmap (0, priv->map[i].buf.length, PROT_READ |
                                  PROT_WRITE, MAP_SHARED,
priv->video_fd,priv->map[i].buf.m.offset);
"

the file descriptor parameter is the file descriptor of the opened
capture device. the offset parameter should be filled in by the opened
device.

does mmap work on freebsd as it works on linux? ie: can i mmap any
device? are there constraints on the device which should be met?

regards,

usleep


More information about the freebsd-questions mailing list