application.c File Reference

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

`#include <osmocom/core/application.h>`
`#include <osmocom/core/logging.h>`
`#include <signal.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <unistd.h>`
`#include <errno.h>`
`#include <sys/stat.h>`

## Functions

static void | sighup_hdlr (int signal)
void | osmo_init_ignore_signals (void)
| Ignore SIGPIPE, SIGALRM, SIGHUP and SIGIO.
int | osmo_init_logging (const struct log_info *log_info)
| Initialize the osmocom logging framework. More...
int | osmo_daemonize (void)
| Turn the current process into a background daemon. More...

## Variables

struct log_target * | osmo_stderr_target
| the default logging target, logging to stderr

## 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

## osmo_init_logging()

int osmo_init_logging | ( | const struct log_info * | log_info | ) |

Initialize the osmocom logging framework.

Parameters

  [in] | log_info | Array 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 log_add_target(), log_init(), log_set_all_filter(), and log_target_create_stderr().