shutdown(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

okay so bestie, we're in the Arcan Lua API and the page is shutdown(3) β€” yes, manual name folded in right at the top, we love a self-referential moment πŸ‘‘βœ¨

🌸 NAME 🌸

shutdown β€” queue a shutdown event. That's the icon: you're asking the engine to shut down, but the request goes through the queue first πŸ’…

✨ SYNOPSIS ✨

the signature is literally:

nil
shutdown( optmsg, optcode )

πŸ’– DESCRIPTION πŸ’–

This function will shut down the engine and terminate the process when it's deemed safe β€” no cap. The important part is that it will not happen immediately; instead, an event gets queued internally so frameservers and other pending-data related tasks have time to clean up 🧚✨

it's giving "graceful exit era" β€” the shutdown is queued, not instant, so cleanup can happen first πŸ’…

The system's interpretation of optcode varies with the underlying environment, though the EXIT_SUCCESS and EXIT_FAILURE constants are propagated and useful here. There's also a special constant, EXIT_SILENT, that will return an EXIT_SUCCESS to the outer system, but only signal a 'display server lost' action to external clients, rather than asking them to shut down 🌈

πŸŽ€ NOTES πŸŽ€

  1. by default, the exit code corresponds to system EXIT_SUCCESS, but it can be set to a custom value through optcode. πŸ’–
  2. optmsg is filtered to only accept [a-Z,.0-9] and whitespace. 🧚

πŸ¦‹ EXAMPLE πŸ¦‹

first demo β€” shutdown0() just calls it with no args:

function shutdown0()
      return shutdown();
end

πŸ¦‹ EXAMPLE πŸ¦‹

second demo β€” shutdown1() passes a message and a code:

function shutdown1()
      return shutdown("giving up", -1);
end

mwah πŸ’‹ β€” this page is from the system source/version, dated October 2026, and that's the footer tea, periodt. 🫢

πŸ“¦ where this page comes from