Crinit -- Configurable Rootfs Init
crinit-sdefs.h File Reference

(2023-08-02, commit: 9434b31)

Definitions shared between crinit's public and internal APIs. More...

#include <sys/types.h>
Include dependency graph for crinit-sdefs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  crinitTaskListEntry_t
 
struct  crinitTaskList_t
 

Macros

#define CRINIT_SOCKFILE   "/run/crinit/crinit.sock"
 
#define CRINIT_ENV_NOTIFY_NAME   "CRINIT_TASK_NAME"
 
#define CRINIT_TASK_STATE_LOADED   (0 << 0)
 Task state bitmask indicating the task was loaded, but never ran. More...
 
#define CRINIT_TASK_STATE_STARTING   (1 << 0)
 Task state bitmask indicating the task currently spawns a new process. More...
 
#define CRINIT_TASK_STATE_RUNNING   (1 << 1)
 Bitmask indicating the task has spawned a process and is running. More...
 
#define CRINIT_TASK_STATE_DONE   (1 << 2)
 Bitmask indicating a task has finished without error. More...
 
#define CRINIT_TASK_STATE_FAILED   (1 << 3)
 Bitmask indicating a task has finished with an error code. More...
 
#define CRINIT_TASK_STATE_NOTIFIED   (1 << 4)
 Bitmask indicating the state was reported through the sd_notify()-API. More...
 

Typedefs

typedef unsigned long crinitTaskState_t
 Type to store Task state bitmask. More...
 
typedef struct crinitTaskListEntry_t crinitTaskListEntry_t
 
typedef struct crinitTaskList_t crinitTaskList_t
 
typedef enum crinitShutdownCmd_t crinitShutdownCmd_t
 

Enumerations

enum  crinitShutdownCmd_t { CRINIT_SHD_UNDEF = 0 , CRINIT_SHD_POWEROFF = 1 , CRINIT_SHD_REBOOT = 2 }
 

Detailed Description

Definitions shared between crinit's public and internal APIs.

Macro Definition Documentation

◆ CRINIT_ENV_NOTIFY_NAME

#define CRINIT_ENV_NOTIFY_NAME   "CRINIT_TASK_NAME"

The name/key of the environment variable Crinit passes to child processes for sd_notify().

◆ CRINIT_SOCKFILE

#define CRINIT_SOCKFILE   "/run/crinit/crinit.sock"

Default path to Crinit's AF_UNIX communication socket.

◆ CRINIT_TASK_STATE_DONE

#define CRINIT_TASK_STATE_DONE   (1 << 2)

Bitmask indicating a task has finished without error.

◆ CRINIT_TASK_STATE_FAILED

#define CRINIT_TASK_STATE_FAILED   (1 << 3)

Bitmask indicating a task has finished with an error code.

◆ CRINIT_TASK_STATE_LOADED

#define CRINIT_TASK_STATE_LOADED   (0 << 0)

Task state bitmask indicating the task was loaded, but never ran.

◆ CRINIT_TASK_STATE_NOTIFIED

#define CRINIT_TASK_STATE_NOTIFIED   (1 << 4)

Bitmask indicating the state was reported through the sd_notify()-API.

◆ CRINIT_TASK_STATE_RUNNING

#define CRINIT_TASK_STATE_RUNNING   (1 << 1)

Bitmask indicating the task has spawned a process and is running.

◆ CRINIT_TASK_STATE_STARTING

#define CRINIT_TASK_STATE_STARTING   (1 << 0)

Task state bitmask indicating the task currently spawns a new process.

Typedef Documentation

◆ crinitShutdownCmd_t

Type to represent the shutdown action crinit shall perform.

◆ crinitTaskList_t

Type to represent a list of tasks.

◆ crinitTaskListEntry_t

Type to represent an entry in a task list.

◆ crinitTaskState_t

typedef unsigned long crinitTaskState_t

Type to store Task state bitmask.

Enumeration Type Documentation

◆ crinitShutdownCmd_t

Type to represent the shutdown action crinit shall perform.

Enumerator
CRINIT_SHD_UNDEF 

undefined/error value

CRINIT_SHD_POWEROFF 

perform a graceful shutdown

CRINIT_SHD_REBOOT 

perform a graceful reboot