rc_find_pids(3)

rc_find_pids3

Finds the pids of processes that match the given criteria

Usage

#include <rc.h>

RC_PIDLIST * Fo rc_find_pids
const char *const *argv const char *cmd uid_t uid pid_t pid);

Library

Run Command library (librc, -lrc)

Overview

rc_find_pids() returns RC_PIDLIST, a structure based on the LIST macro from queue(3) which contains all the pids found matching the given criteria. If pid is given then only that pid is returned if it is running. Otherwise we check all instances of argv with a process name of cmd owned by uid, all of which are optional.

The returned list should be freed when done.

Implementation notes

On BSD systems we use Kernel Data Access Library (libkvm, -lkvm) and on Linux systems we use the /proc filesystem to find our processes.

Each RC_PID should be freed in the list as well as the list itself when done.

Releases

6 releases since Debian 8 (Jessie); the text changed 2 times.

  1. 8
  2. 9–11
  3. 12–13

Authors

Roy Marples <[email protected]>

From librc-dev 0.56-1 in Debian 13 (Trixie). Parsed by carta from the page's mdoc source.