How to properly clean up on asynchronous or sudden shutdown?
I have an user space application that performs file I/O operations, when a SIGKILL is captured, some routines are done first to ensure that all I/O operations are completed before rebooting the application or system. My question is, this won't work if the power button is pressed or the power supply is disconnected, so there can be incomplete I/O operation or corrupted data written into the file, so is there a way to prevent data corruption or at least complete any ongoing operation when this scenario happens? Assuming there is at most 1 second before the power really went out, can I/O be still completed?'
I'm running the application on a busybox 2.6.14 kernel on an embedded system board.
Regards,
archieval
Last edited by archieval; 06-06-2010 at 11:57 PM.
|