The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
API for managing concurrent file access. More...
#include <freeradius-devel/server/request.h>
Go to the source code of this file.
Typedefs | |
typedef struct exfile_s | exfile_t |
Functions | |
int | exfile_close (exfile_t *lf, CC_RELEASE_HANDLE("exfile_fd") int fd) |
void | exfile_enable_triggers (exfile_t *ef, CONF_SECTION *cs, char const *trigger_prefix, fr_pair_list_t *trigger_args) |
Enable triggers for an exfiles handle. More... | |
exfile_t * | exfile_init (TALLOC_CTX *ctx, uint32_t entries, fr_time_delta_t idle, bool locking) |
Initialize a way for multiple threads to log to one or more files. More... | |
int | exfile_open (exfile_t *lf, char const *filename, mode_t permissions, off_t *offset) |
Open a new log file, or maybe an existing one. More... | |
API for managing concurrent file access.
Definition in file exfile.h.
int exfile_close | ( | exfile_t * | lf, |
CC_RELEASE_HANDLE("exfile_fd") int | fd | ||
) |
void exfile_enable_triggers | ( | exfile_t * | ef, |
CONF_SECTION * | conf, | ||
char const * | trigger_prefix, | ||
fr_pair_list_t * | trigger_args | ||
) |
Enable triggers for an exfiles handle.
[in] | ef | to enable triggers for. |
[in] | conf | section to search for triggers in. |
[in] | trigger_prefix | prefix to prepend to all trigger names. Usually a path to the module's trigger configuration .e.g. modules.<name>.file <trigger name>is appended to form the complete path. |
[in] | trigger_args | to make available in any triggers executed by the exfile api. Exfile-File is automatically added to this list. |
Definition at line 196 of file exfile.c.
exfile_t* exfile_init | ( | TALLOC_CTX * | ctx, |
uint32_t | max_entries, | ||
fr_time_delta_t | max_idle, | ||
bool | locking | ||
) |
Initialize a way for multiple threads to log to one or more files.
ctx | The talloc context |
max_entries | Max file descriptors to cache, and manage locks for. |
max_idle | Maximum time a file descriptor can be idle before it's closed. |
locking | whether or not to lock the files. |
Definition at line 148 of file exfile.c.
Open a new log file, or maybe an existing one.
When multithreaded, the FD is locked via a mutex. This way we're sure that no other thread is writing to the file.
ef | The logfile context returned from exfile_init(). |
filename | the file to open. |
permissions | to use. |
offset | Optional pointer to store offset in when seeking the end of file. |
Definition at line 506 of file exfile.c.