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-generic.h>
11 static inline int trace_user_generic_slow_printf(
18 /* Guess we need no more than 100 bytes. */
24 if ((p
= malloc (size
)) == NULL
)
28 /* Try to print in the allocated space. */
30 n
= vsnprintf (p
, size
, fmt
, ap
);
32 /* If that worked, trace the string. */
33 if (n
> -1 && n
< size
) {
34 ret
= trace_user_generic_slow_printf_param_buffer(p
, n
+1);
38 /* Else try again with more space. */
39 if (n
> -1) /* glibc 2.1 */
40 size
= n
+1; /* precisely what is needed */
42 size
*= 2; /* twice the old size */
43 if ((np
= realloc (p
, size
)) == NULL
) {
53 #endif //_LTT_FACILITY_CUSTOM_USER_GENERIC_H_
This page took 0.038498 seconds and 5 git commands to generate.