logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

__pmCleanMapDir - remove old files from a map directory

C Synopsis

#include"pmapi.h"#include"libpcp.h"int__pmCleanMapDir(constchar*dirname,constchar*special);cc...-lpcp

Caveat

       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.

Description

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 encoding 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.

Diagnostics

       Verbose  diagnostics  describing the actions of __pmCleanMapDir will be reported on standard error of the
       debug option misc is set, e.g. via -Dmisc from the command line.

Name

__pmCleanMapDir - remove old files from a map directory

Return Values

       If a serious error  occurs,  __pmCleanMapDir  returns  a  negative  value  suitable  for  reporting  with
       pmErrStr(3).  Otherwise the return value is the number of entries that have been removed.

See Also

pmdbg(1), PMAPI(3) and pmErrStr(3).

Performance Co-Pilot                                   PCP                                      PMCLEANMAPDIR(3)

See Also