ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/getppid.htm

125 lines
3.3 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>getppid()--Get Process ID of Parent Process</title>
<!-- Begin Header Records ========================================== -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Change History: -->
<!-- UNIX11 SCRIPT A converted by B2H R4.1 (346) (CMS) by V2DCIJB at -->
<!-- RCHVMW2 on 1 Jun 1999 at 16:14:12 -->
<!-- Edited by Kersten Feb 02 -->
<!-- This file has undergone html cleanup July 2002 by JET -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!--End Header Records -->
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>getppid()--Get Process ID of Parent Process</h2>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;sys/types.h&gt;
#include &lt;unistd.h&gt;
pid_t getppid(void);
</pre>
<br>
&nbsp;&nbsp;Service Program Name: QP0WSRV1<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <strong>getppid()</strong> function returns the parent process ID of the
calling process.</p>
<br>
<h3>Parameters</h3>
<p>None</p>
<br>
<h3>Authorities</h3>
<p>None.</p>
<br>
<h3>Return Value</h3>
<table cellpadding="5">
<!-- cols="10 90" -->
<tr>
<td align="left" valign="top"><em>pid_t</em></td>
<td align="left" valign="top">The value returned by <strong>getppid()</strong>
is the process ID of the parent process for the calling process. A process ID
value of 1 indicates that there is no parent process associated with the
calling process.</td>
</tr>
</table>
<br>
<br>
<h3>Error Conditions</h3>
<p>The <strong>getppid()</strong> function is always successful and does not
return an error.</p>
<br>
<h3>Related Information</h3>
<ul>
<li>The &lt;<strong>sys/types.h</strong>&gt; file (see <a href=
"unix13.htm">Header Files for UNIX-Type Functions</a>)<br>
<br>
</li>
<li>The &lt;<strong>unistd.h</strong>&gt; file (see <a href="unix13.htm">Header
Files for UNIX-Type Functions</a>)<br>
<br>
</li>
<li><a href="qgtppid.htm">Qp0wGetPPid()</a>--Get Process ID of Parent
Process</li>
</ul>
<br>
<h3>Example</h3>
<p>See <a href="../apiref/aboutapis.htm#codedisclaimer">Code disclaimer information</a>
for information pertaining to code examples.</p>
<p>For an example of using this function, see the child program in
<a href="../apiref/apiexuspro.htm">Using the Spawn Process and Wait for Child Process APIs</a></p>
<br>
<hr>
API introduced: V3R6
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"unix.htm">UNIX-Type APIs</a> | <a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</center>
</body>
</html>