Avoid crash after doing mmap() on a file that is unmounted

后端 未结 4 1393
感动是毒
感动是毒 2020-12-30 15:29

I\'m doing mmap() on a file that can be unmounted ( the file is located on an USB device which the user can remove at any time ), and my application crashes if the file is u

4条回答
  •  情歌与酒
    2020-12-30 15:58

    you can get notification about any change on file(s), dir(s) by using http://linux.die.net/man/7/inotify. you may consider using IN_DELETE.

提交回复
热议问题