tor  0.4.2.0-alpha-dev
Functions
main.h File Reference

Go to the source code of this file.

Functions

void handle_signals (void)
 
void activate_signal (int signal_num)
 
int try_locking (const or_options_t *options, int err_if_locked)
 
int have_lockfile (void)
 
void release_lockfile (void)
 
void tor_remove_file (const char *filename)
 
int tor_init (int argc, char **argv)
 
int run_tor_main_loop (void)
 

Detailed Description

Header file for main.c.

Definition in file main.h.

Function Documentation

◆ handle_signals()

void handle_signals ( void  )

Set up the signal handler events for this process, and register them with libevent if appropriate.

Definition at line 481 of file main.c.

◆ have_lockfile()

int have_lockfile ( void  )

Return true iff we've successfully acquired the lock file.

Definition at line 714 of file main.c.

References lockfile.

◆ release_lockfile()

void release_lockfile ( void  )

If we have successfully acquired the lock file, release it.

Definition at line 721 of file main.c.

References lockfile, and tor_lockfile_unlock().

◆ tor_remove_file()

void tor_remove_file ( const char *  filename)

Remove the specified file, and log a warning if the operation fails for any reason other than the file not existing. Ignores NULL filenames.

Definition at line 734 of file main.c.

Referenced by tor_cleanup().

◆ try_locking()

int try_locking ( const or_options_t options,
int  err_if_locked 
)

Try to grab the lock file described in options, if we do not already have it. If err_if_locked is true, warn if somebody else is holding the lock, and exit if we can't get it after waiting. Otherwise, return -1 if we can't get the lockfile. Return 0 on success.

Definition at line 678 of file main.c.

References lockfile.