summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-03-14 21:16:24 +0100
committerSergei Golubchik <sergii@pisem.net>2012-03-14 21:16:24 +0100
commit44ea4e7c1f90f80ab5cf55f435856acca7a176db (patch)
tree29b6ddd92aaa202477a375e554a319538d2919cb /include
parent8245178f5d55d2f1f90e87a78a0c5c5245875809 (diff)
downloadmariadb-git-44ea4e7c1f90f80ab5cf55f435856acca7a176db.tar.gz
restore my_safe_printf_stderr for "crash-safe sigsegv handler"
use vsnprintf() use write() on windows, not WriteFile or fwrite() localtime_r is still a problem
Diffstat (limited to 'include')
-rw-r--r--include/my_global.h4
-rw-r--r--include/my_stacktrace.h44
2 files changed, 4 insertions, 44 deletions
diff --git a/include/my_global.h b/include/my_global.h
index 5dca5710055..6f3103f930f 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -569,6 +569,10 @@ int __void__;
#endif
#endif /* DONT_DEFINE_VOID */
+#ifndef STDERR_FILENO
+#define STDERR_FILENO 2
+#endif
+
/*
Deprecated workaround for false-positive uninitialized variables
warnings. Those should be silenced using tool-specific heuristics.
diff --git a/include/my_stacktrace.h b/include/my_stacktrace.h
index a2fd89852fc..7585f00da90 100644
--- a/include/my_stacktrace.h
+++ b/include/my_stacktrace.h
@@ -61,50 +61,6 @@ void my_set_exception_pointers(EXCEPTION_POINTERS *ep);
void my_write_core(int sig);
#endif
-
-
-/**
- Async-signal-safe utility functions used by signal handler routines.
- Declared here in order to unit-test them.
- These are not general-purpose, but tailored to the signal handling routines.
-*/
-/**
- Converts a longlong value to string.
- @param base 10 for decimal, 16 for hex values (0..9a..f)
- @param val The value to convert
- @param buf Assumed to point to the *end* of the buffer.
- @returns Pointer to the first character of the converted string.
- Negative values:
- for base-10 the return string will be prepended with '-'
- for base-16 the return string will contain 16 characters
- Implemented with simplicity, and async-signal-safety in mind.
-*/
-char *my_safe_itoa(int base, longlong val, char *buf);
-
-/**
- Converts a ulonglong value to string.
- @param base 10 for decimal, 16 for hex values (0..9a..f)
- @param val The value to convert
- @param buf Assumed to point to the *end* of the buffer.
- @returns Pointer to the first character of the converted string.
- Implemented with simplicity, and async-signal-safety in mind.
-*/
-char *my_safe_utoa(int base, ulonglong val, char *buf);
-
-/**
- A (very) limited version of snprintf.
- @param to Destination buffer.
- @param n Size of destination buffer.
- @param fmt printf() style format string.
- @returns Number of bytes written, including terminating '\0'
- Supports 'd' 'i' 'u' 'x' 'p' 's' conversion.
- Supports 'l' and 'll' modifiers for integral types.
- Does not support any width/precision.
- Implemented with simplicity, and async-signal-safety in mind.
-*/
-size_t my_safe_snprintf(char* to, size_t n, const char* fmt, ...)
- ATTRIBUTE_FORMAT(printf, 3, 4);
-
/**
A (very) limited version of snprintf, which writes the result to STDERR.
@sa my_safe_snprintf