<refmeta>
  <refentrytitle>utracer_check_pid</refentrytitle>
  <manvolnum>2</manvolnum>
</refmeta>

<refnamediv>
  <refname>utracer_check_pid</refname>
  <refpurpose>verifies that a specified pid is attached to a specified
  client</refpurpose> 
</refnamediv>

<refsynopsisdiv>
  <funcsynopsis>
    <funcsynopsisinfo>
      #include &lt;utracer.h&gt;
    </funcsynopsisinfo>
    <funcprototype>
      <funcdef>long <function>utracer_check_pid</function></funcdef>
      <paramdef>long <parameter>client_pid</parameter></paramdef>
      <paramdef>long <parameter>traced_pid</parameter></paramdef>
    </funcprototype>
  </funcsynopsis>
</refsynopsisdiv>

<refsect1><title>Description</title>
  <para>
    The <function>utracer_check_pid</function>() function verifies that the
    process specified by the <parameter>traced_pid</parameter> parameter
    is attached to the client specified by the
    <parameter>client_pid</parameter> parameter.
  </para>
</refsect1>

<refsect1>
  <title>Return Value</title>
  <para>
    If successful, <function>utracer_check_pid</function>() returns zero,
    indicating that the process specified by <parameter>traced_pid</parameter>
    exists and is attached to the specified client.  If the call is not
    successful, it will return a -1 and set <varname>errno</varname>.  The
    value of <varname>errno</varname> will be either of those appropriate to
    the <function>open</function>() system call (q.v.) or one of the following
    (some of which are unique to the utracer module).
  </para>
</refsect1>

<refsect1>
  <title>Errors</title>
  <variablelist>
      
    <varlistentry>
      <term><constant>ESRCH</constant></term>
      <listitem>
	<para>
	  The traced process no longer exists.
	</para>
      </listitem>
    </varlistentry>
      
    <varlistentry>
      <term><constant>UTRACER_ETRACING</constant></term>
      <listitem>
	<para>
	  The process specified by the <parameter>client_pid</parameter>
          parameter either doesn't exist or isn't registered as a utracer
          client.
	</para>
      </listitem>
    </varlistentry>

    <varlistentry>
      <term><constant>UTRACER_ETRACED</constant></term>
      <listitem>
        <para>
          The process specified by the <parameter>traced_pid</parameter>
          parameter has not been registered (via
          <function>utracer_attach</function>()) with utracer.
        </para>
      </listitem>
    </varlistentry>
      
    <varlistentry>
      <term><constant>UTRACER_EENGINE</constant></term>
      <listitem>
	<para>
	  The process specified by the <parameter>traced_pid</parameter>
          parameter is no longer attached.
	</para>
      </listitem>
    </varlistentry>
  </variablelist>
</refsect1>

&xref;

