Crinit -- Configurable Rootfs Init
optfeat.c File Reference

(2023-08-28, commit: 649e63b)

Implementation of optional behavior dependent on available system features. More...

#include "optfeat.h"
#include <string.h>
#include "common.h"
#include "elosio.h"
#include "globopt.h"
#include "logio.h"
#include "taskdb.h"
Include dependency graph for optfeat.c:

Classes

struct  crinitOptFeatMap_t
 

Typedefs

typedef int(* crinitFeatActivationFunc_t) (void *data)
 
typedef struct crinitOptFeatMap_t crinitOptFeatMap_t
 

Functions

static int crinitActivateSyslog (void *data)
 
static int crinitElosioActivateCb (void *data)
 
static int crinitElosioTaskAddedCb (void *data)
 
int crinitFeatureHook (const char *sysFeatName, crinitHookType_t type, void *data)
 

Detailed Description

Implementation of optional behavior dependent on available system features.

Typedef Documentation

◆ crinitFeatActivationFunc_t

typedef int(* crinitFeatActivationFunc_t) (void *data)

◆ crinitOptFeatMap_t

Function Documentation

◆ crinitActivateSyslog()

static int crinitActivateSyslog ( void *  data)
static

◆ crinitElosioActivateCb()

static int crinitElosioActivateCb ( void *  data)
static

◆ crinitElosioTaskAddedCb()

static int crinitElosioTaskAddedCb ( void *  data)
static

◆ crinitFeatureHook()

int crinitFeatureHook ( const char *  sysFeatName,
crinitHookType_t  type,
void *  data 
)

Hook to be called whenever a new feature is provided by a task.

Meant to be used to let Crinit change its own behavior whenever a relevant (optional or delayed) feature needed for some special functionality gets provided.

Currently only handles activation of syslog functionality if series config option USE_SYSLOG is true and a task provides syslog.

Parameters
sysFeatNameName of the newly-provided feature.
typeType of the invoked hook.
dataHook payload.
Returns
0 on success, -1 otherwise