4 ms·
There's a syscall to check whether the computer is on so just call that before this and you'll be fine
by ancode 5y ago
There's a syscall to check whether the computer is on so just call that before this and you'll be fine
- Someone 5y agoThat introduces a time-of-check to time-of-use bug (https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use).
- nvader 5y agoAh, good ole TOCTOU
- waterhouse 5y agoAha. If only the API was "Execute a user-provided function in a context where the computer is guaranteed to be on".