NAME | C SYNOPSIS | DESCRIPTION | DIAGNOSTICS | COMPATIBILITY | SEE ALSO | COLOPHON |
|
|
PMPARSEINTERVAL(3) Library Functions Manual PMPARSEINTERVAL(3)
pmParseInterval - convert interval string to binary time structure
#include <pcp/pmapi.h> int pmParseInterval(const char *string, struct timespec *rslt, char **errmsg); cc ... -lpcp
pmParseInterval parses the argument string specifying an interval of time and fills in the tv_sec and tv_nsec components of the rslt structure to represent that interval (nanosecond precision). The input string is most commonly the argument following a -t com‐ mand line option to a PCP application, and the syntax is fully de‐ scribed in PCPIntro(1).
pmParseInterval returns 0 and errmsg is undefined if the parsing is successful. If the given string does not conform to the required syntax pmPar‐ seInterval returns -1 and a dynamically allocated error message string in errmsg. The error message is terminated with a newline and includes the text of the input string along with an indicator of the position at which the error was detected, e.g. 4minutes 30mumble ^ -- unexpected value In the case of an error, the caller is responsible for calling free(3) to release the space allocated for errmsg.
Prior to PCP 7.0 the rslt argument was a struct timeval. To sup‐ port PMAPI transition, the old interface and semantics can be used if applications are recompiled with -DPMAPI_VERSION=2. For a time in PCP 6.x there was a routine with the same semantics as the current pmParseInterval called pmParseHighResInterval al‐ though this is now deprecated and compile-time support for pm‐ ParseHighResInterval will be removed in a future release.
PCPIntro(1), free(3), PMAPI(3) and pmParseTimeWindow(3).
This page is part of the PCP (Performance Co-Pilot) project. In‐
formation about the project can be found at ⟨http://www.pcp.io/⟩.
If you have a bug report for this manual page, send it to
pcp@groups.io. This page was obtained from the project's upstream
Git repository ⟨https://github.com/performancecopilot/pcp.git⟩ on
2025-08-11. (At that time, the date of the most recent commit
that was found in the repository was 2025-08-11.) If you discover
any rendering problems in this HTML version of the page, or you
believe there is a better or more up-to-date source for the page,
or you have corrections or improvements to the information in this
COLOPHON (which is not part of the original manual page), send a
mail to man-pages@man7.org
Performance Co-Pilot PCP PMPARSEINTERVAL(3)
Pages that refer to this page: pcp-free(1), pcp-meminfo(1), pcp-mpstat(1), pcp-netstat(1), pcp-pidstat(1), pcp-ps(1), pcp-rocestat(1), pcp-slabinfo(1), pcp-zoneinfo(1), pmseries(1), __pmconverttime(3), __pmparsectime(3), __pmparsetime(3), pmparsetimewindow(3), pmwebapi(3)