Y
Hacker News
new
|
ask
|
show
|
jobs
by
ancode
1678 days ago
There's a syscall to check whether the computer is on so just call that before this and you'll be fine
1 comments
Someone
1678 days ago
That introduces a time-of-check to time-of-use bug (
https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use
).
link
waterhouse
1678 days ago
Aha. If only the API was "Execute a user-provided function in a context where the computer is guaranteed to be on".
link
nvader
1678 days ago
Ah, good ole TOCTOU
link