automotive-dlt
dlt_cdh.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <syslog.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include "dlt_cdh.h"
#include <dirent.h>
Include dependency graph for dlt_cdh.c:

Go to the source code of this file.

Macros

#define UNUSUAL_CHARS   ":/\\!*"
 
#define REPLACEMENT_CHAR   '_'
 
#define COREDUMP_FILESYSTEM   "/var"
 
#define COREDUMP_FILESYSTEM_MIN_SIZE_MB   40
 
#define COREDUMP_HANDLER_PRIORITY   -19
 

Functions

void core_locks (const proc_info_t *p_proc, int action)
 
void init_proc_info (proc_info_t *p_proc)
 
cdh_status_t read_args (int argc, char **argv, proc_info_t *proc)
 
void remove_unusual_chars (char *p_string)
 
cdh_status_t check_disk_space ()
 
void clean_core_tmp_dir ()
 
cdh_status_t check_and_create_directory (const char *p_dirname, int create_silently)
 
cdh_status_t check_core_directory ()
 
cdh_status_t move_to_core_directory (proc_info_t *p_proc)
 
int main (int argc, char *argv[])
 

Detailed Description

Author
Magneti Marelli http://www.magnetimarelli.com
Lutz Helwing lutz_.nosp@m.helw.nosp@m.ing@m.nosp@m.ento.nosp@m.r.com

Definition in file dlt_cdh.c.

Macro Definition Documentation

#define COREDUMP_FILESYSTEM   "/var"

Definition at line 48 of file dlt_cdh.c.

Referenced by check_disk_space().

#define COREDUMP_FILESYSTEM_MIN_SIZE_MB   40

Definition at line 49 of file dlt_cdh.c.

Referenced by check_disk_space().

#define COREDUMP_HANDLER_PRIORITY   -19

Definition at line 50 of file dlt_cdh.c.

Referenced by main().

#define REPLACEMENT_CHAR   '_'

Definition at line 46 of file dlt_cdh.c.

Referenced by remove_unusual_chars().

#define UNUSUAL_CHARS   ":/\\!*"

Definition at line 45 of file dlt_cdh.c.

Referenced by remove_unusual_chars().

Function Documentation

cdh_status_t check_and_create_directory ( const char *  p_dirname,
int  create_silently 
)

Definition at line 242 of file dlt_cdh.c.

References CDH_NOK, and CDH_OK.

Referenced by check_core_directory().

cdh_status_t check_core_directory ( )
cdh_status_t check_disk_space ( )

Definition at line 176 of file dlt_cdh.c.

References CDH_NOK, CDH_OK, COREDUMP_FILESYSTEM, and COREDUMP_FILESYSTEM_MIN_SIZE_MB.

Referenced by main().

void clean_core_tmp_dir ( )

Definition at line 199 of file dlt_cdh.c.

References CORE_LOCK_DIRECTORY, CORE_MAX_FILENAME_LENGTH, CORE_TMP_DIRECTORY, and NULL.

Referenced by check_core_directory().

void core_locks ( const proc_info_t p_proc,
int  action 
)
cdh_status_t read_args ( int  argc,
char **  argv,
proc_info_t proc 
)
void remove_unusual_chars ( char *  p_string)

Definition at line 146 of file dlt_cdh.c.

References NULL, REPLACEMENT_CHAR, and UNUSUAL_CHARS.

Referenced by main().