1 #ifndef _LTT_FACILITY_CUSTOM_USER_GENERIC_H_
2 #define _LTT_FACILITY_CUSTOM_USER_GENERIC_H_
5 #include <ltt/ltt-facility-id-user_generic.h>
6 #include <ltt/ltt-usertrace.h>
15 static int trace_user_generic_slow_printf(
22 /* Guess we need no more than 100 bytes. */
28 size
+= ltt_align(size
, sizeof(void*));
29 if ((p
= malloc (size
)) == NULL
)
33 /* Try to print in the allocated space. */
35 n
= vsnprintf (p
, size
, fmt
, ap
);
37 /* If that worked, trace the string. */
38 if (n
> -1 && n
< size
) {
39 ret
= trace_user_generic_slow_printf_param_buffer(p
, n
+1+ltt_align(n
+1, sizeof(void*)));
43 /* Else try again with more space. */
44 if (n
> -1) /* glibc 2.1 */
45 size
= n
+1; /* precisely what is needed */
47 size
*= 2; /* twice the old size */
48 size
+= ltt_align(size
, sizeof(void*));
49 if ((np
= realloc (p
, size
)) == NULL
) {
60 } /* end of extern "C" */
63 #endif //_LTT_FACILITY_CUSTOM_USER_GENERIC_H_
This page took 0.034712 seconds and 4 git commands to generate.