Functions | |
char* | alloca () |
RETSIGTYPE | signalHandler (int sig) |
Signal handler to set shutdown flag. More... | |
char* | ip2str (u_int32 ip) |
Gets the string representation of a given IP address. More... | |
void | executeCmd (char *cmd,...) |
Executes a system command with the given parameters. More... | |
pid_t | daemonize () |
Make the current process a daemon. More... | |
void | setSignals (int *fShutdown) |
Catches SIGTERM and SIGINT. More... | |
Variables | |
int* | fShutdownp = NULL |
Pointer to the shutdown flag. |
|
|
|
Make the current process a daemon. Forks off and closes all files.
|
|
Executes a system command with the given parameters. This function is just a wrapper arround fork/execv that forks and executes the given command. The full path to the command is <libexecdir>/wccpd/cmd. It will wait for the command to complete before it returns. The variable length char* parameter list must be NULL terminated, and must not exceed MAX_CMDEXEC_ARGS parameters (not including neither the command name nor the trailing NULL).
|
|
Gets the string representation of a given IP address. This function uses a statically allocated buffer, thus each call overwrites the previous call's result.
|
|
Catches SIGTERM and SIGINT. Each time one of the signals is received, the integer pointed to by fShutdown is incremented.
|
|
Signal handler to set shutdown flag. This signal handler just increments the variable pointed by fShutdownp, if non-NULL.
|
|
Pointer to the shutdown flag.
|