PMDESTROYCONTEXT(3)
π PMDESTROYCONTEXT(3) β bestie, we're cleaning up contexts today
okay so real talk, this is the pmDestroyContext page from section 3 of the manual, and it's literally the "bye babe, closing the connection" function. no cap.
β¨ NAME β¨
pmDestroyContext β destroy a PMAPI context ποΈπ
πΈ C SYNOPSIS πΈ
#include <pcp/pmapi.h>
int pmDestroyContext(int handle);
cc ... -lpcp
like yes, that's the whole thing, she's simple but she's iconic π
π¦ DESCRIPTION π¦
sooo an application using the Performance Metrics Application Programming Interface (PMAPI) can manipulate several concurrent contexts at once, and each one of those is associated with a source of performance metrics β for example pmcd(1) running on some host, or an archive of performance metrics as created by pmlogger(1). multiple vibes, multiple contexts, we love that for us π
pmDestroyContext destroys the PMAPI context identified by handle. typically this would imply some termination of a connection to a PMCD or closing an archive file, and orderly clean-up. it's giving "we're leaving the party but we're taking our coat and saying goodbye properly" π§
π¨ the context must have been previously created usingpmNewContext(3)orpmDupContext(3). no making up handles out of thin air, bestie, that's not the vibe.
on success, pmDestroyContext returns zero π
but here's the tea π β if handle was the current PMAPI context, then the current context becomes undefined. which means the application must explicitly re-establish a valid PMAPI context with pmUseContext(3), or create a new context with pmNewContext(3) or pmDupContext(3), before the next PMAPI operation that requires a PMAPI context. like, you can't just keep going, the app has to go get a new context first, periodt π
π DIAGNOSTICS π
PM_ERR_NOCONTEXTβhandledoes not identify a valid PMAPI context. it's giving "who?? never heard of her" π
π₯ SEE ALSO π₯
Performance Co-Pilot π PCP β mwah, that's the source and the version right there, and this whole page is dated PMDESTROYCONTEXT(3) energy. stay hydrated, close your contexts, and go slay πβ¨π«Ά
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu resolute: libpcp4-dev 7.1.1-1
- ubuntu stonking: libpcp4-dev 7.2.1-2build1
- Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms