| NAME | C SYNOPSIS | CAVEAT | DESCRIPTION | RETURN VALUES | DIAGNOSTICS | SEE ALSO | COLOPHON | |
|  | 
PMCLEANMAPDIR(3)         Library Functions Manual        PMCLEANMAPDIR(3)
       __pmCleanMapDir - remove old files from a map directory
       #include "pmapi.h"
       #include "libpcp.h"
       int __pmCleanMapDir(const char *dirname, const char *special);
       cc ... -lpcp
       This  documentation  is intended for internal Performance Co-Pilot
       (PCP) developer use.
       These interfaces are not part of the PCP APIs that are  guaranteed
       to  remain  fixed  across  releases, and they may not work, or may
       provide different semantics at some point in the future.
       pmlogger(1) and pmie(1) maintain directories  of  map  files  that
       provide  a  mapping from a pmlogger(1) or pmie(1) process id (PID)
       to important parameters of those processes.
       __pmCleanMapDir  removes  ``dead''  files  in  these  directories,
       specifically  the directory entries in dirname should follow these
       rules, else __pmCleanMapDir will remove them:
       + the name should be numeric, else it should be equal special (if
         special is not NULL)
       + for a numeric directory entry it should be a regular file and
         the name should be the PID of a running process
       + for a match on special the directory entry should be a symbolic
         link and the last component of the link should be the ASCII en‐
         coding of the PID of a running process
       Before any of these checks are done, __pmCleanMapDir checks that
       dirname is indeed a directory, and the user id and group id of the
       caller match the user id and group id of dirname.
       If a serious error occurs, __pmCleanMapDir returns a negative val‐
       ue suitable for reporting with pmErrStr(3).  Otherwise the return
       value is the number of entries that have been removed.
       Verbose diagnostics describing the actions of __pmCleanMapDir will
       be reported on standard error of the debug option misc is set,
       e.g. via -D misc from the command line.
       pmdbg(1), PMAPI(3) and pmErrStr(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                   PMCLEANMAPDIR(3)