~ubuntu-branches/ubuntu/raring/mysql-5.5/raring-proposed

« back to all changes in this revision

Viewing changes to include/my_stacktrace.h

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-02-14 23:59:22 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120214235922-cux5uek1e5l0hje9
Tags: 5.5.20-0ubuntu1
* New upstream release.
* d/mysql-server-5.5.mysql.upstart: Fix stop on to make sure mysql is
  fully stopped before shutdown commences. (LP: #688541) Also simplify
  start on as it is redundant.
* d/control: Depend on upstart version which has apparmor profile load
  script to prevent failure on upgrade from lucid to precise.
  (LP: #907465)
* d/apparmor-profile: need to allow /run since that is the true path
  of /var/run files. (LP: #917542)
* d/control: mysql-server-5.5 has files in it that used to be owned
  by libmysqlclient-dev, so it must break/replace it. (LP: #912487)
* d/rules, d/control: 5.5.20 Fixes segfault on tests with gcc 4.6,
  change compiler back to system default.
* d/rules: Turn off embedded libedit/readline.(Closes: #659566)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
 
1
/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
   This program is free software; you can redistribute it and/or modify
4
4
   it under the terms of the GNU General Public License as published by
59
59
void my_write_core(int sig);
60
60
#endif
61
61
 
 
62
 
 
63
 
 
64
/**
 
65
  Async-signal-safe utility functions used by signal handler routines.
 
66
  Declared here in order to unit-test them.
 
67
  These are not general-purpose, but tailored to the signal handling routines.
 
68
*/
 
69
/**
 
70
  Converts a longlong value to string.
 
71
  @param   base 10 for decimal, 16 for hex values (0..9a..f)
 
72
  @param   val  The value to convert
 
73
  @param   buf  Assumed to point to the *end* of the buffer.
 
74
  @returns Pointer to the first character of the converted string.
 
75
           Negative values:
 
76
           for base-10 the return string will be prepended with '-'
 
77
           for base-16 the return string will contain 16 characters
 
78
  Implemented with simplicity, and async-signal-safety in mind.
 
79
*/
 
80
char *my_safe_itoa(int base, longlong val, char *buf);
 
81
 
 
82
/**
 
83
  Converts a ulonglong value to string.
 
84
  @param   base 10 for decimal, 16 for hex values (0..9a..f)
 
85
  @param   val  The value to convert
 
86
  @param   buf  Assumed to point to the *end* of the buffer.
 
87
  @returns Pointer to the first character of the converted string.
 
88
  Implemented with simplicity, and async-signal-safety in mind.
 
89
*/
 
90
char *my_safe_utoa(int base, ulonglong val, char *buf);
 
91
 
 
92
/**
 
93
  A (very) limited version of snprintf.
 
94
  @param   to   Destination buffer.
 
95
  @param   n    Size of destination buffer.
 
96
  @param   fmt  printf() style format string.
 
97
  @returns Number of bytes written, including terminating '\0'
 
98
  Supports 'd' 'i' 'u' 'x' 'p' 's' conversion.
 
99
  Supports 'l' and 'll' modifiers for integral types.
 
100
  Does not support any width/precision.
 
101
  Implemented with simplicity, and async-signal-safety in mind.
 
102
*/
 
103
size_t my_safe_snprintf(char* to, size_t n, const char* fmt, ...)
 
104
  ATTRIBUTE_FORMAT(printf, 3, 4);
 
105
 
 
106
/**
 
107
  A (very) limited version of snprintf, which writes the result to STDERR.
 
108
  @sa my_safe_snprintf
 
109
  Implemented with simplicity, and async-signal-safety in mind.
 
110
  @note Has an internal buffer capacity of 512 bytes,
 
111
  which should suffice for our signal handling routines.
 
112
*/
 
113
size_t my_safe_printf_stderr(const char* fmt, ...)
 
114
  ATTRIBUTE_FORMAT(printf, 1, 2);
 
115
 
 
116
/**
 
117
  Writes up to count bytes from buffer to STDERR.
 
118
  Implemented with simplicity, and async-signal-safety in mind.
 
119
  @param   buf   Buffer containing data to be written.
 
120
  @param   count Number of bytes to write.
 
121
  @returns Number of bytes written.
 
122
*/
 
123
size_t my_write_stderr(const void *buf, size_t count);
 
124
 
62
125
C_MODE_END
63
126
 
64
127
#endif /* _my_stacktrace_h_ */