0

Hi I feel confused about open file and mmapped file. I know that if a file is accessed using system call such as read/write will return a file descriptor, and be considered as an open file? How about a mmaped file?

Thanks,

  • " I know that if a file is accessed using system call such as read/write will return a file descriptor," ... don't you need a file descriptor to use read or write in the first place? This question is confusing. – Olorin Mar 5 at 8:16
  • See this answer to another question about mmap. You need an open file descriptor to call mmap, but after that the kernel will use a hidden descriptor and you can close the file descriptor you opened. The memory mapped by mmap will continue to be available. – Mark Plotnick Mar 5 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.