summaryrefslogtreecommitdiff
path: root/man/man3/pmerrstr.3
diff options
context:
space:
mode:
Diffstat (limited to 'man/man3/pmerrstr.3')
-rw-r--r--man/man3/pmerrstr.369
1 files changed, 69 insertions, 0 deletions
diff --git a/man/man3/pmerrstr.3 b/man/man3/pmerrstr.3
new file mode 100644
index 0000000..3b26dc2
--- /dev/null
+++ b/man/man3/pmerrstr.3
@@ -0,0 +1,69 @@
+'\"macro stdmacro
+.\"
+.\" Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
+.\"
+.\" This program is free software; you can redistribute it and/or modify it
+.\" under the terms of the GNU General Public License as published by the
+.\" Free Software Foundation; either version 2 of the License, or (at your
+.\" option) any later version.
+.\"
+.\" This program is distributed in the hope that it will be useful, but
+.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+.\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+.\" for more details.
+.\"
+.\"
+.TH PMERRSTR 3 "PCP" "Performance Co-Pilot"
+.SH NAME
+\f3pmErrStr\f1,
+\f3pmErrStr_r\f1 \- convert a PMAPI error code into a string
+.SH "C SYNOPSIS"
+.ft 3
+#include <pcp/pmapi.h>
+.sp
+const char *pmErrStr(int \fIcode\fP);
+.br
+char *pmErrStr_r(int \fIcode\fP, char *\fIbuf\fP, int \fIbuflen\fP);
+.sp
+cc ... \-lpcp
+.ft 1
+.SH DESCRIPTION
+Translate an error code into a text string, suitable for generating a
+diagnostic message.
+The
+.B pmErrStr_r
+function does the same, but stores the result in a user-supplied buffer
+.I buf
+of length
+.IR buflen ,
+which should have room for at least
+.B PM_MAXERRMSGLEN
+bytes.
+.PP
+By convention, all error codes are negative.
+The small
+values are assumed to be negated versions of the Unix error codes as defined
+in
+.B <errno.h>
+and the strings returned are as per
+.BR strerror (3C).
+The larger, negative error codes are
+Performance Metrics Application Programming Interface (PMAPI)
+error conditions and
+.BR pmErrStr (3)
+returns an appropriate PMAPI error string, as determined by
+.IR code .
+.SH NOTES
+.B pmErrStr
+returns a pointer to a static buffer,
+so the returned value is only valid until the next call to
+.B pmErrStr
+and hence is not thread-safe.
+Multi-threaded applications should use
+.B pmErrStr_r
+instead.
+.SH SEE ALSO
+.BR pmerr (1),
+.BR PMAPI (3)
+and
+.BR perror (3C).