Files
Get-fix 520b9facb6 fix(libc): export daemon
VLC (PPSA85300) imports daemon (Wn6I3wVATUE) and fails to load because
no library exports it. Forking into the background is not supported,
so it throws if called. VLC 3.0 calls daemon only when its daemon
option is set, and the title starts libVLC with --ignore-config and
without --daemon.
2026-10-11 09:40:35 +02:00

20 lines
658 B
C++

#include "prx/libc/include/general/VabiMacros.hpp"
#include <cstdlib>
#include <stdexcept>
#include <string>
extern "C" int APS5_VABI daemon_nid_postfix(int, int);
static void Require(bool value) { if (!value) std::abort(); }
static bool ReportsNotImplemented(int noChdir, int noClose) {
try {
daemon_nid_postfix(noChdir, noClose);
} catch (const std::runtime_error& error) {
return std::string(error.what()) == "daemon: forking into the background not implemented";
}
return false;
}
int main() {
Require(ReportsNotImplemented(1, 0));
Require(ReportsNotImplemented(0, 0));
Require(ReportsNotImplemented(1, 1));
}