libosmocore 1.11.0.26-c59d
Osmocom core library
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
application.h File Reference

Routines for helping with the osmocom application setup. More...

Go to the source code of this file.

Functions

void osmo_init_ignore_signals (void)
 Ignore SIGPIPE, SIGALRM, SIGHUP and SIGIO. More...
 
int osmo_init_logging (const struct log_info *) OSMO_DEPRECATED("use osmo_init_logging2() instead to avoid a NULL talloc ctx")
 Initialize the osmocom logging framework. More...
 
int osmo_init_logging2 (void *ctx, const struct log_info *log_info)
 
int osmo_daemonize (void)
 Turn the current process into a background daemon. More...
 

Variables

struct log_targetosmo_stderr_target
 the default logging target, logging to stderr More...
 

Detailed Description

Routines for helping with the osmocom application setup.

Function Documentation

◆ osmo_daemonize()

int osmo_daemonize ( void  )

Turn the current process into a background daemon.

This function will fork the process, exit the parent and set umask, create a new session, close stdin/stdout/stderr and chdir to /tmp

References pid.

◆ osmo_init_ignore_signals()

void osmo_init_ignore_signals ( void  )

Ignore SIGPIPE, SIGALRM, SIGHUP and SIGIO.

References sighup_hdlr().

◆ osmo_init_logging()

int osmo_init_logging ( const struct log_info log_info)

Initialize the osmocom logging framework.

Parameters
[in]log_infoArray of available logging sub-systems
Returns
0 on success, -1 in case of error

This function initializes the osmocom logging systems. It also creates the default (stderr) logging target.

References osmo_init_logging2().

◆ osmo_init_logging2()

int osmo_init_logging2 ( void *  ctx,
const struct log_info log_info 
)

Variable Documentation

◆ osmo_stderr_target

struct log_target* osmo_stderr_target
extern

the default logging target, logging to stderr

Referenced by osmo_init_logging2().