The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions | Variables
main_loop.c File Reference

Creates a global event loop, and manages signalling between the forked child and its parent as the server starts. More...

#include <freeradius-devel/server/cf_parse.h>
#include <freeradius-devel/server/main_loop.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/server/state.h>
#include <freeradius-devel/server/trigger.h>
#include <freeradius-devel/server/util.h>
#include <freeradius-devel/util/misc.h>
#include <freeradius-devel/util/syserror.h>
#include <signal.h>
#include <fcntl.h>
+ Include dependency graph for main_loop.c:

Go to the source code of this file.

Functions

static int _loop_status (UNUSED fr_time_t now, fr_time_delta_t wake, UNUSED void *ctx)
 
fr_event_list_tmain_loop_event_list (void)
 Return the main loop event list. More...
 
void main_loop_free (void)
 
int main_loop_init (void)
 Initialise the main event loop, setting up signal handlers. More...
 
static void main_loop_signal_process (int flag)
 
void main_loop_signal_raise (int flag)
 
static void main_loop_signal_recv (UNUSED fr_event_list_t *xel, UNUSED int fd, UNUSED int flags, UNUSED void *ctx)
 I/O handler listening on the signal pipe. More...
 
int main_loop_start (void)
 

Variables

static fr_event_list_tevent_list = NULL
 
pid_t radius_pid
 
static int self_pipe [2] = { -1, -1 }
 

Detailed Description

Creates a global event loop, and manages signalling between the forked child and its parent as the server starts.

Id
6e889f26d1449bdb79eab8cb380659f090f395a6

Definition in file main_loop.c.

Function Documentation

◆ _loop_status()

static int _loop_status ( UNUSED fr_time_t  now,
fr_time_delta_t  wake,
UNUSED void *  ctx 
)
static

Definition at line 235 of file main_loop.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main_loop_event_list()

fr_event_list_t* main_loop_event_list ( void  )

Return the main loop event list.

Definition at line 162 of file main_loop.c.

+ Here is the caller graph for this function:

◆ main_loop_free()

void main_loop_free ( void  )

Definition at line 187 of file main_loop.c.

+ Here is the caller graph for this function:

◆ main_loop_init()

int main_loop_init ( void  )

Initialise the main event loop, setting up signal handlers.

This has to be done post-fork in case we're using kqueue, where the queue isn't inherited by the child process.

Returns
  • 0 on success.
  • -1 on failure.

Definition at line 251 of file main_loop.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main_loop_signal_process()

static void main_loop_signal_process ( int  flag)
static

Definition at line 103 of file main_loop.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main_loop_signal_raise()

void main_loop_signal_raise ( int  flag)

Definition at line 79 of file main_loop.c.

+ Here is the caller graph for this function:

◆ main_loop_signal_recv()

static void main_loop_signal_recv ( UNUSED fr_event_list_t xel,
UNUSED int  fd,
UNUSED int  flags,
UNUSED void *  ctx 
)
static

I/O handler listening on the signal pipe.

Definition at line 142 of file main_loop.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main_loop_start()

int main_loop_start ( void  )

Definition at line 192 of file main_loop.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ event_list

fr_event_list_t* event_list = NULL
static

Definition at line 48 of file main_loop.c.

◆ radius_pid

pid_t radius_pid
extern

◆ self_pipe

int self_pipe[2] = { -1, -1 }
static

Definition at line 49 of file main_loop.c.