Hacker News new | ask | show | jobs
by agildehaus 364 days ago
Reminds me of BeOS (and now Haiku), which have "is_computer_on()" and "is_computer_on_fire()" both with great descriptions.

https://www.haiku-os.org/legacy-docs/bebook/TheKernelKit_Sys...

4 comments

Reminds me of Delphi -- it has an exception 'EProgrammerNotFound'.

https://docwiki.embarcadero.com/Libraries/Athens/en/System.S...

With a completely serious (though short) documentation page I read as very, very dry humour.

I know it is trying to be funny. But those states are quite normal in modern computer with advanced power management. OS should handle wakeups from deep sleep, or state where temperature of motherboard is 200 celsius.
Unlikely. Nothing is specced beyond 140 Celsius and many parts not beyond 80.
That statement is far too general and also factually wrong e.g. HT83C51 is specced for operating temperatures of 225 deg Celsius
That's still not a chip where an OS would have to handle motherboard temperatures of 200C, like the original point though. An 8051 is going to be running bare metal. TI has some stuff in the C2000 line that can run FreeRTOS at 200C, but the overwhelmingly vast majority of chips on the market are rated to 150C max.
Sleep / hibernate doesn't change anything here - if the computer is in those states, no code is running so it doesn't make sense to query for it, which is the joke. The function isn't called was_computer_running().
looking around a bit, it's used as an example in the documentation:

https://github.com/haiku/haiku/blob/7d07c4bc739dbf90159a5c02...

This is actually a great reason to keep it around; it's as simple as possible, and nothing uses it so it's easy to find the relevant bits of code.

Makes sense:

is_computer_on() int32 is_computer_on(); Returns 1 if the computer is on. If the computer isn't on, the value returned by this function is undefined.

The latter missed a golden opportunity to be some kind of async event-based trigger.