RocketLogger  1.0
lib_util.h File Reference
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include "types.h"
+ Include dependency graph for lib_util.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int check_sample_rate (int sample_rate)
 
int check_update_rate (int update_rate)
 
pid_t get_pid (void)
 
int set_pid (pid_t pid)
 

Function Documentation

int check_sample_rate ( int  sample_rate)

Copyright (c) 2016-2017, ETH Zurich, Computer Engineering Group

Check if provided sampling rate is possible

Parameters
sample_rateSampling rate
Returns
SUCCESS if possible, FAILURE otherwise

Definition at line 22 of file lib_util.c.

References FAILURE, NUMBER_SAMPLE_RATES, possible_sample_rates, and SUCCESS.

Referenced by parse_args(), and rl_start().

int check_update_rate ( int  update_rate)

Check if provided update rate is possible

Parameters
update_rateUpdate rate
Returns
SUCCESS if possible, FAILURE otherwise

Definition at line 37 of file lib_util.c.

References FAILURE, NUMBER_UPDATE_RATES, possible_update_rates, and SUCCESS.

Referenced by parse_args(), and rl_start().

pid_t get_pid ( void  )

Get process ID (PID) of background sampling process

Returns
PID of background process

Definition at line 51 of file lib_util.c.

References FAILURE, and PID_FILE.

Referenced by rl_get_status(), rl_read_status(), and rl_stop().

int set_pid ( pid_t  pid)

Store process ID (PID)

Parameters
pidOwn PID
Returns
SUCCESS in case of success, FAILURE otherwise.

Definition at line 74 of file lib_util.c.

References ERROR, FAILURE, PID_FILE, rl_log(), and SUCCESS.

Referenced by rl_start().

+ Here is the call graph for this function: