Crinit -- Configurable Rootfs Init
crinit-sdefs.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: MIT
6 #ifndef __CRINIT_SDEFS_H__
7 #define __CRINIT_SDEFS_H__
8 
9 #include <sys/types.h>
10 
12 #define CRINIT_SOCKFILE "/run/crinit/crinit.sock"
13 
15 #define CRINIT_ENV_NOTIFY_NAME "CRINIT_TASK_NAME"
16 
17 typedef unsigned long crinitTaskState_t;
18 #define CRINIT_TASK_STATE_LOADED (0 << 0)
19 #define CRINIT_TASK_STATE_STARTING (1 << 0)
20 #define CRINIT_TASK_STATE_RUNNING (1 << 1)
21 #define CRINIT_TASK_STATE_DONE (1 << 2)
22 #define CRINIT_TASK_STATE_FAILED (1 << 3)
23 #define CRINIT_TASK_STATE_NOTIFIED (1 << 4)
24 
26 typedef struct crinitTaskListEntry_t {
27  char *name;
28  pid_t pid;
31 
33 typedef struct crinitTaskList_t {
34  size_t numTasks;
37 
39 typedef enum crinitShutdownCmd_t {
44 
45 #endif /* __CRINIT_SDEFS_H__ */
crinitShutdownCmd_t
Definition: crinit-sdefs.h:39
@ CRINIT_SHD_REBOOT
perform a graceful reboot
Definition: crinit-sdefs.h:42
@ CRINIT_SHD_POWEROFF
perform a graceful shutdown
Definition: crinit-sdefs.h:41
@ CRINIT_SHD_UNDEF
undefined/error value
Definition: crinit-sdefs.h:40
struct crinitTaskList_t crinitTaskList_t
unsigned long crinitTaskState_t
Type to store Task state bitmask.
Definition: crinit-sdefs.h:17
struct crinitTaskListEntry_t crinitTaskListEntry_t
Definition: crinit-sdefs.h:26
char * name
Task name.
Definition: crinit-sdefs.h:27
pid_t pid
PID of currently running process subordinate to the task, if any.
Definition: crinit-sdefs.h:28
crinitTaskState_t state
Task state.
Definition: crinit-sdefs.h:29
Definition: crinit-sdefs.h:33
size_t numTasks
Number of elements in the tasks array.
Definition: crinit-sdefs.h:34
crinitTaskListEntry_t * tasks
Array of task entries.
Definition: crinit-sdefs.h:35