using munmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I've devellopped a driver, and my application can communicate with it via the mmap system.


I didn't use the munmap function since the region is automatically unmapped when the process is 
terminated.

I've got to make "restarts" in my application, so the mmap will be called several times:
	ptr = (u_int *) mmap (NULL, size * sizeof (u_int), PROT_READ | PROT_WRITE , MAP_SHARED, fd, 0);
I tried to call munmap with the same arguments as the mmap call, it fails saying "Invalid argument".
	munmap ((void *)ptr, size * sizeof (u_int));

Does anybody can help me?
What will happen if I make severals mmap without any munmap?


Thank's



Frederic

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux