← Back to context Comment by koakuma-chan 19 hours ago How do you handle read/write errors with mmap? 3 comments koakuma-chan Reply Falcondor 19 hours ago mmap on file io errors would manifest in Signals (For example SIGBUS or SIGSEGV).So if you wanted to handle file read/write errors you would need to implement signal handlers.https://stackoverflow.com/questions/6791415/how-do-memory-ma... koakuma-chan 19 hours ago ... which is not great for an API. icedchai 17 hours ago In my experience, having worked with a large system that used almost exclusively mmap for I/O, you don’t. The process segfaults and is restarted. In practice it almost never happened.
Falcondor 19 hours ago mmap on file io errors would manifest in Signals (For example SIGBUS or SIGSEGV).So if you wanted to handle file read/write errors you would need to implement signal handlers.https://stackoverflow.com/questions/6791415/how-do-memory-ma... koakuma-chan 19 hours ago ... which is not great for an API.
icedchai 17 hours ago In my experience, having worked with a large system that used almost exclusively mmap for I/O, you don’t. The process segfaults and is restarted. In practice it almost never happened.
mmap on file io errors would manifest in Signals (For example SIGBUS or SIGSEGV).
So if you wanted to handle file read/write errors you would need to implement signal handlers.
https://stackoverflow.com/questions/6791415/how-do-memory-ma...
... which is not great for an API.
In my experience, having worked with a large system that used almost exclusively mmap for I/O, you don’t. The process segfaults and is restarted. In practice it almost never happened.