FlatImage
A configurable Linux containerization system
Loading...
Searching...
No Matches
portal_daemon.cpp File Reference

Spawns a daemon that receives child process requests. More...

#include <cerrno>
#include <chrono>
#include <cstdlib>
#include <expected>
#include <fcntl.h>
#include <sys/prctl.h>
#include <sys/wait.h>
#include <thread>
#include <string>
#include <csignal>
#include <filesystem>
#include <unistd.h>
#include "../std/expected.hpp"
#include "../lib/log.hpp"
#include "../lib/env.hpp"
#include "../lib/linux/fifo.hpp"
#include "../db/portal/message.hpp"
#include "../db/portal/daemon.hpp"
#include "../macro.hpp"
#include "config.hpp"
#include "child.hpp"
Include dependency graph for portal_daemon.cpp:

Go to the source code of this file.

Functions

void cleanup (int sig)
 Signal handler for daemon cleanup.
 
int main ()
 Entry point for the portal daemon.
 

Variables

char ** environ
 
volatile std::sig_atomic_t G_CONTINUE = 1
 

Detailed Description

Spawns a daemon that receives child process requests.

Author
Ruan Formigoni

Definition in file portal_daemon.cpp.

Function Documentation

◆ cleanup()

void cleanup ( int sig)

Signal handler for daemon cleanup.

Sets the G_CONTINUE flag to 0 to signal the daemon's main loop to exit.

Parameters
sigSignal number (unused)

Definition at line 51 of file portal_daemon.cpp.

◆ main()

int main ( )

Entry point for the portal daemon.

Returns
int Exit code (0 for success, non-zero for failure)

Definition at line 61 of file portal_daemon.cpp.

Here is the call graph for this function:

Variable Documentation

◆ G_CONTINUE

volatile std::sig_atomic_t G_CONTINUE = 1

Definition at line 42 of file portal_daemon.cpp.