1PMSPRINTF(3) Library Functions Manual PMSPRINTF(3)
2
3
4
6 pmsprintf - formatted string conversion
7
9 #include <pcp/pmapi.h>
10
11 int pmsprintf(char *str, size_t size, const char *fmt, ... /*args*/);
12
13 cc ... -lpcp
14
16 Safe string formatting interface that wraps the vsnprintf(3) call.
17
18 It differs primarily in that pmsprintf guarantees that the output buf‐
19 fer str will be null-terminated even when the provided buffer size is
20 insufficient to contain the formatted string. In this case a null-ter‐
21 minated truncated string will be returned in str.
22
23 In the case of a failure in the underlying vsnprintf interface, a null-
24 terminated empty string will be returned in str, and the return value
25 will be zero.
26
28 On successful completion, pmsprintf returns the number of characters
29 written to the supplied buffer, not including the null terminator.
30
31 The return code is always zero or more, never negative.
32
34 vsnprintf(3), pmprintf(3) and PMAPI(3).
35
36
37
38Performance Co-Pilot PCP PMSPRINTF(3)