3 ms·
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-doc
by agildehaus 1y 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_SystemInfo.html https://www.haiku-os.org/legacy-docs/bebook/TheKernelKit_Sys...
- yomimiva 1y agoFor the curious minds: https://github.com/haiku/haiku/blob/master/src/system/libroot/os/system_info.cpp#L215 https://github.com/haiku/haiku/blob/master/src/system/libroo...
- tomn 1y agolooking around a bit, it's used as an example in the documentation: https://github.com/haiku/haiku/blob/7d07c4bc739dbf90159a5c02e48b9118c47ebbcd/docs/develop/kernel/system_calls.rst 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.
- vjvjvjvjghv 1y agoMakes 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.
- throw74848484 1y agoI 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.
- mordae 1y agoUnlikely. Nothing is specced beyond 140 Celsius and many parts not beyond 80.
- kxndnddn 1y agoThat statement is far too general and also factually wrong e.g. HT83C51 is specced for operating temperatures of 225 deg Celsius
- AlotOfReading 1y agoThat'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.
- account42 1y agoSleep / 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().
- vintagedave 1y agoReminds me of Delphi -- it has an exception 'EProgrammerNotFound'. https://docwiki.embarcadero.com/Libraries/Athens/en/System.SysUtils.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.
- rkagerer 1y agoThe latter missed a golden opportunity to be some kind of async event-based trigger.