27 #ifdef HAVE_SYS_TIME_H
36 #ifdef HAVE_SYS_TYPES_H
37 #include <sys/types.h>
57 size_t len = strlen(s);
61 err += (r != (ssize_t)len);
75 time_t now = time(NULL);
83 timebuf[0] = now < 0 ?
'-' :
' ';
84 if (now < 0) now = -now;
88 "================== T=");
93 while ((x = va_arg(ap,
const char*))) {
149 int fds[] = { STDERR_FILENO };
166 const int *fds = NULL;
169 for (i = 0; i < n_fds; ++i) {
201 file,
":", linebuf,
": ", expr,
"\n", NULL);
207 dump_stack_symbols_to_error_fds();
231 format_number_sigsafe(
unsigned long x,
char *buf,
int buf_len,
241 if (radix < 2 || radix > 16)
247 while (tmp >= radix) {
253 if (!buf || len >= buf_len)
259 unsigned digit = (unsigned) (x % radix);
265 *cp =
"0123456789ABCDEF"[digit];
300 return format_number_sigsafe(x, buf, buf_len, 16);
307 return format_number_sigsafe(x, buf, buf_len, 10);
const char * get_tor_backtrace_version(void)
Definitions for timing-related constants.
void tor_log_flush_sigsafe_err_fds(void)
void tor_log_sigsafe_err_set_granularity(int ms)
void tor_log_reset_sigsafe_err_fds(void)
int format_dec_number_sigsafe(unsigned long x, char *buf, int buf_len)
void tor_log_set_sigsafe_err_fds(const int *fds, int n)
void tor_raw_assertion_failed_msg_(const char *file, int line, const char *expr, const char *msg)
int format_hex_number_sigsafe(unsigned long x, char *buf, int buf_len)
void tor_log_err_sigsafe(const char *m,...)
static int sigsafe_log_fds[TOR_SIGSAFE_LOG_MAX_FDS]
void tor_raw_abort_(void)
static int log_granularity
static int n_sigsafe_log_fds
int tor_log_get_sigsafe_err_fds(const int **out)
static int tor_log_err_sigsafe_write(const char *s)
#define TOR_SIGSAFE_LOG_MAX_FDS