Tor  0.4.7.0-alpha-dev
Macros | Typedefs | Functions
procmon.h File Reference

Headers for procmon.c. More...

#include "lib/evloop/compat_libevent.h"
#include "lib/log/log.h"

Go to the source code of this file.

Macros

#define tor_process_monitor_free(procmon)    FREE_AND_NULL(tor_process_monitor_t, tor_process_monitor_free_, (procmon))
 

Typedefs

typedef void(* tor_procmon_callback_t) (void *)
 

Functions

int tor_validate_process_specifier (const char *process_spec, const char **msg)
 
tor_process_monitor_ttor_process_monitor_new (struct event_base *base, const char *process_spec, log_domain_mask_t log_domain, tor_procmon_callback_t cb, void *cb_arg, const char **msg)
 
void tor_process_monitor_free_ (tor_process_monitor_t *procmon)
 

Detailed Description

Headers for procmon.c.

Definition in file procmon.h.

Function Documentation

◆ tor_process_monitor_free_()

void tor_process_monitor_free_ ( tor_process_monitor_t procmon)

Free the process-termination monitor procmon.

Definition at line 325 of file procmon.c.

◆ tor_process_monitor_new()

tor_process_monitor_t* tor_process_monitor_new ( struct event_base *  base,
const char *  process_spec,
log_domain_mask_t  log_domain,
tor_procmon_callback_t  cb,
void *  cb_arg,
const char **  msg 
)

Create a process-termination monitor for the process specifier given in process_spec. Return a newly allocated tor_process_monitor_t on success; return NULL and store an error message into *msg on failure. The caller must not free the returned error message.

When the monitored process terminates, call cb(cb_arg).

Definition at line 181 of file procmon.c.

◆ tor_validate_process_specifier()

int tor_validate_process_specifier ( const char *  process_spec,
const char **  msg 
)

Verify that the process specifier given in process_spec is syntactically valid. Return 0 on success; return -1 and store an error message into *msg on failure. The caller must not free the returned error message.

Definition at line 157 of file procmon.c.