Crinit -- Configurable Rootfs Init
Loading...
Searching...
No Matches
elos-common.c File Reference

(/usr/bin/git 2025-01-08, commit: bb3c890)

#include "elos-common.h"
#include <dlfcn.h>
#include <errno.h>
#include "confparse.h"
#include "globopt.h"
#include "logio.h"
Include dependency graph for elos-common.c:

Functions

static int crinitElosdepFetchElosSymbol (void *lp, const char *symbolName, void **symbol)
 
int crinitElosInit (void)
 
crinitElosVirtualTable_tcrinitElosGetVTable (void)
 
int crinitElosDisconnect (crinitElosSession_t *session, pthread_mutex_t *sessionLock)
 

Variables

static crinitElosVirtualTable_t crinitElosVTable
 
static pthread_mutex_t crinitElosVTableLock = PTHREAD_MUTEX_INITIALIZER
 

Function Documentation

◆ crinitElosdepFetchElosSymbol()

static int crinitElosdepFetchElosSymbol ( void *  lp,
const char *  symbolName,
void **  symbol 
)
inlinestatic

Fetches a single symbol from the elos client shared library.

Parameters
lpPointer to the elos shared library
symbolNameName of the symbol to be fetched
symbolFunction pointer to be assigned
Returns
Returns 1 on success, 0 otherwise.

◆ crinitElosDisconnect()

int crinitElosDisconnect ( crinitElosSession_t session,
pthread_mutex_t *  sessionLock 
)

Disconnect from elos daemon.

Parameters
sessionSession to disconnect.
sessionLockThe session lock.
Returns
Returns 0 on success, -1 otherwise.

◆ crinitElosGetVTable()

crinitElosVirtualTable_t * crinitElosGetVTable ( void  )

Returns the internal elos virtual table.

◆ crinitElosInit()

int crinitElosInit ( void  )

Initializes the elos vtable.

Returns
Returns 0 on success, -1 otherwise.

Variable Documentation

◆ crinitElosVTable

crinitElosVirtualTable_t crinitElosVTable
static

Elos connection data and callbacks.

◆ crinitElosVTableLock

pthread_mutex_t crinitElosVTableLock = PTHREAD_MUTEX_INITIALIZER
static

Mutex protecting elos vtable initialization