1

Can we TWO MMAP on same /dev file

view story
linux-howto

http://stackoverflow.com – I have build an character driver in which i am allocating two PAGESIZE buffer using dma_alloc_coherent() Now i am passing the PHYSICAL address of these BUFFER [src_ptr & dest_ptr] to user space using ioctl() as source_offset and dest_offset . In user space this offeset is used as an offset for mmap call. So on same /dev file say /dev/250 i am making TWO MMAP call usr_src_ptr= mmap(0,page_size, PROT_READ|PROT_WRITE, MAP_SHARED,dev_FD, src_offset ); if (usr_src_ptr == MAP_FAILED){ printf("USR[UPP]:SOURCE MMAP FAiled \n (HowTos)