MCPcopy Create free account
hub / github.com/apache/httpd / log_tid

Function log_tid

server/log.c:628–655  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626}
627
628static int log_tid(const ap_errorlog_info *info, const char *arg,
629 char *buf, int buflen)
630{
631#if APR_HAS_THREADS
632 int result;
633#endif
634#if defined(HAVE_GETTID) || defined(HAVE_SYS_GETTID)
635 if (arg && *arg == 'g') {
636#ifdef HAVE_GETTID
637 pid_t tid = gettid();
638#else
639 pid_t tid = syscall(SYS_gettid);
640#endif
641 if (tid == -1)
642 return 0;
643 return apr_snprintf(buf, buflen, "%"APR_PID_T_FMT, tid);
644 }
645#endif /* HAVE_GETTID || HAVE_SYS_GETTID */
646#if APR_HAS_THREADS
647 if (ap_mpm_query(AP_MPMQ_IS_THREADED, &result) == APR_SUCCESS
648 && result != AP_MPMQ_NOT_SUPPORTED)
649 {
650 apr_os_thread_t tid = apr_os_thread_current();
651 return apr_snprintf(buf, buflen, "%pT", &tid);
652 }
653#endif
654 return 0;
655}
656
657static int log_ctime(const ap_errorlog_info *info, const char *arg,
658 char *buf, int buflen)

Callers 1

do_errorlog_defaultFunction · 0.85

Calls 1

ap_mpm_queryFunction · 0.85

Tested by

no test coverage detected