1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>Libgtop Reference Manual: Process List</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7
<link rel="home" href="index.html" title="Libgtop Reference Manual">
8
<link rel="up" href="libgtop-lib.html" title="Libgtop Library Reference">
9
<link rel="prev" href="libgtop-version.html" title="version">
10
<link rel="next" href="libgtop-sem-limits.html" title="sem_limits">
11
<meta name="generator" content="GTK-Doc V1.20 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="10"><tr valign="middle">
16
<td width="100%" align="left" class="shortcuts">
17
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
18
<a href="#libgtop-Process-List.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
19
<a href="#libgtop-Process-List.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
21
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
22
<td><a accesskey="u" href="libgtop-lib.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
23
<td><a accesskey="p" href="libgtop-version.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
24
<td><a accesskey="n" href="libgtop-sem-limits.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
26
<div class="refentry">
27
<a name="libgtop-Process-List"></a><div class="titlepage"></div>
28
<div class="refnamediv"><table width="100%"><tr>
30
<h2><span class="refentrytitle"><a name="libgtop-Process-List.top_of_page"></a>Process List</span></h2>
31
<p>Process List — List running processes</p>
33
<td class="gallery_image" valign="top" align="right"></td>
35
<div class="refsect1">
36
<a name="libgtop-Process-List.stability-level"></a><h2>Stability Level</h2>
37
Stable, unless otherwise indicated
39
<div class="refsect1">
40
<a name="libgtop-Process-List.functions"></a><h2>Functions</h2>
41
<div class="informaltable"><table width="100%" border="0">
43
<col width="150px" class="functions_return">
44
<col class="functions_name">
47
<td class="function_type">
48
<span class="returnvalue">pid_t</span> *
50
<td class="function_name">
51
<a class="link" href="libgtop-Process-List.html#glibtop-get-proclist" title="glibtop_get_proclist ()">glibtop_get_proclist</a> <span class="c_punctuation">()</span>
56
<div class="refsect1">
57
<a name="libgtop-Process-List.other"></a><h2>Types and Values</h2>
58
<div class="informaltable"><table width="100%" border="0">
60
<col width="150px" class="name">
61
<col class="description">
65
<td class="define_keyword">#define</td>
66
<td class="function_name"><a class="link" href="libgtop-Process-List.html#GLIBTOP-KERN-PROC-ALL:CAPS" title="GLIBTOP_KERN_PROC_ALL">GLIBTOP_KERN_PROC_ALL</a></td>
69
<td class="define_keyword">#define</td>
70
<td class="function_name"><a class="link" href="libgtop-Process-List.html#GLIBTOP-KERN-PROC-PID:CAPS" title="GLIBTOP_KERN_PROC_PID">GLIBTOP_KERN_PROC_PID</a></td>
73
<td class="define_keyword">#define</td>
74
<td class="function_name"><a class="link" href="libgtop-Process-List.html#GLIBTOP-KERN-PROC-PGRP:CAPS" title="GLIBTOP_KERN_PROC_PGRP">GLIBTOP_KERN_PROC_PGRP</a></td>
77
<td class="define_keyword">#define</td>
78
<td class="function_name"><a class="link" href="libgtop-Process-List.html#GLIBTOP-KERN-PROC-SESSION:CAPS" title="GLIBTOP_KERN_PROC_SESSION">GLIBTOP_KERN_PROC_SESSION</a></td>
81
<td class="define_keyword">#define</td>
82
<td class="function_name"><a class="link" href="libgtop-Process-List.html#GLIBTOP-KERN-PROC-TTY:CAPS" title="GLIBTOP_KERN_PROC_TTY">GLIBTOP_KERN_PROC_TTY</a></td>
85
<td class="define_keyword">#define</td>
86
<td class="function_name"><a class="link" href="libgtop-Process-List.html#GLIBTOP-KERN-PROC-UID:CAPS" title="GLIBTOP_KERN_PROC_UID">GLIBTOP_KERN_PROC_UID</a></td>
89
<td class="define_keyword">#define</td>
90
<td class="function_name"><a class="link" href="libgtop-Process-List.html#GLIBTOP-KERN-PROC-RUID:CAPS" title="GLIBTOP_KERN_PROC_RUID">GLIBTOP_KERN_PROC_RUID</a></td>
93
<td class="define_keyword">#define</td>
94
<td class="function_name"><a class="link" href="libgtop-Process-List.html#GLIBTOP-KERN-PROC-MASK:CAPS" title="GLIBTOP_KERN_PROC_MASK">GLIBTOP_KERN_PROC_MASK</a></td>
97
<td class="define_keyword">#define</td>
98
<td class="function_name"><a class="link" href="libgtop-Process-List.html#GLIBTOP-EXCLUDE-IDLE:CAPS" title="GLIBTOP_EXCLUDE_IDLE">GLIBTOP_EXCLUDE_IDLE</a></td>
101
<td class="define_keyword">#define</td>
102
<td class="function_name"><a class="link" href="libgtop-Process-List.html#GLIBTOP-EXCLUDE-SYSTEM:CAPS" title="GLIBTOP_EXCLUDE_SYSTEM">GLIBTOP_EXCLUDE_SYSTEM</a></td>
105
<td class="define_keyword">#define</td>
106
<td class="function_name"><a class="link" href="libgtop-Process-List.html#GLIBTOP-EXCLUDE-NOTTY:CAPS" title="GLIBTOP_EXCLUDE_NOTTY">GLIBTOP_EXCLUDE_NOTTY</a></td>
109
<td class="datatype_keyword">struct</td>
110
<td class="function_name"><a class="link" href="libgtop-Process-List.html#glibtop-proclist" title="struct glibtop_proclist">glibtop_proclist</a></td>
115
<div class="refsect1">
116
<a name="libgtop-Process-List.object-hierarchy"></a><h2>Object Hierarchy</h2>
120
<div class="refsect1">
121
<a name="libgtop-Process-List.includes"></a><h2>Includes</h2>
122
<pre class="synopsis">#include <glibtop/proclist.h>
125
<div class="refsect1">
126
<a name="libgtop-Process-List.description"></a><h2>Description</h2>
128
<div class="refsect1">
129
<a name="libgtop-Process-List.functions_details"></a><h2>Functions</h2>
130
<div class="refsect2">
131
<a name="glibtop-get-proclist"></a><h3>glibtop_get_proclist ()</h3>
132
<pre class="programlisting"><span class="returnvalue">pid_t</span> *
133
glibtop_get_proclist (<em class="parameter"><code><a class="link" href="libgtop-Process-List.html#glibtop-proclist" title="struct glibtop_proclist"><span class="type">glibtop_proclist</span></a> *buf</code></em>,
134
<em class="parameter"><code><span class="type">gint64</span> which</code></em>,
135
<em class="parameter"><code><span class="type">gint64</span> arg</code></em>);</pre>
136
<div class="refsect3">
137
<a name="id-1.3.28.9.2.4"></a><h4>Parameters</h4>
138
<div class="informaltable"><table width="100%" border="0">
140
<col width="150px" class="parameters_name">
141
<col class="parameters_description">
142
<col width="200px" class="parameters_annotations">
146
<td class="parameter_name"><p>buf</p></td>
147
<td class="parameter_description"><p>Extra return information, see <a class="link" href="libgtop-Process-List.html#glibtop-proclist" title="struct glibtop_proclist"><span class="type">glibtop_proclist</span></a>.</p></td>
148
<td class="parameter_annotations"> </td>
151
<td class="parameter_name"><p>which</p></td>
152
<td class="parameter_description"><p>Criteria for processes in returned list. See the <span class="type">GLIBTOP_KERN_PROC_*</span> and <span class="type">GLIBTOP_EXCLUDE_*</span> constants.</p></td>
153
<td class="parameter_annotations"> </td>
156
<td class="parameter_name"><p>arg</p></td>
157
<td class="parameter_description"><p>Extra arguments applied to <em class="parameter"><code>which</code></em>
158
. Only <span class="type">GLIBTOP_KERN_PROC_*</span> constants take arguments, see each constant definition for particular <em class="parameter"><code>arg</code></em>
159
description.</p></td>
160
<td class="parameter_annotations"> </td>
165
<div class="refsect3">
166
<a name="id-1.3.28.9.2.5"></a><h4>Returns</h4>
167
<p> A list of running processes or <span class="type">NULL</span> on error. The
168
returned list is allocated using <code class="function">g_malloc</code> and must be
169
freed using <code class="function">g_free</code> to avoid a memory leak.</p>
174
<div class="refsect1">
175
<a name="libgtop-Process-List.other_details"></a><h2>Types and Values</h2>
176
<div class="refsect2">
177
<a name="GLIBTOP-KERN-PROC-ALL:CAPS"></a><h3>GLIBTOP_KERN_PROC_ALL</h3>
178
<pre class="programlisting">#define GLIBTOP_KERN_PROC_ALL 0
180
<p>Return information about all processes</p>
183
<div class="refsect2">
184
<a name="GLIBTOP-KERN-PROC-PID:CAPS"></a><h3>GLIBTOP_KERN_PROC_PID</h3>
185
<pre class="programlisting">#define GLIBTOP_KERN_PROC_PID 1
187
<p>Return all processes with the pid which is passed in <em class="parameter"><code>arg</code></em>
188
. You can use this to find out whether some process still exists.</p>
191
<div class="refsect2">
192
<a name="GLIBTOP-KERN-PROC-PGRP:CAPS"></a><h3>GLIBTOP_KERN_PROC_PGRP</h3>
193
<pre class="programlisting">#define GLIBTOP_KERN_PROC_PGRP 2
195
<p>Return all processes in the process group passed in <em class="parameter"><code>arg</code></em>
199
<div class="refsect2">
200
<a name="GLIBTOP-KERN-PROC-SESSION:CAPS"></a><h3>GLIBTOP_KERN_PROC_SESSION</h3>
201
<pre class="programlisting">#define GLIBTOP_KERN_PROC_SESSION 3
203
<p>Return all processes in the session passed in <em class="parameter"><code>arg</code></em>
207
<div class="refsect2">
208
<a name="GLIBTOP-KERN-PROC-TTY:CAPS"></a><h3>GLIBTOP_KERN_PROC_TTY</h3>
209
<pre class="programlisting">#define GLIBTOP_KERN_PROC_TTY 4
211
<p>Return all processes which have the controlling tty passed in <em class="parameter"><code>arg</code></em>
213
(which is interpreted as the device number).</p>
216
<div class="refsect2">
217
<a name="GLIBTOP-KERN-PROC-UID:CAPS"></a><h3>GLIBTOP_KERN_PROC_UID</h3>
218
<pre class="programlisting">#define GLIBTOP_KERN_PROC_UID 5
220
<p>Return all processes with the effective uid passed in <em class="parameter"><code>arg</code></em>
224
<div class="refsect2">
225
<a name="GLIBTOP-KERN-PROC-RUID:CAPS"></a><h3>GLIBTOP_KERN_PROC_RUID</h3>
226
<pre class="programlisting">#define GLIBTOP_KERN_PROC_RUID 6
228
<p>Return all processes with the real uid passed in <em class="parameter"><code>arg</code></em>
232
<div class="refsect2">
233
<a name="GLIBTOP-KERN-PROC-MASK:CAPS"></a><h3>GLIBTOP_KERN_PROC_MASK</h3>
234
<pre class="programlisting">#define GLIBTOP_KERN_PROC_MASK 15
240
<div class="refsect2">
241
<a name="GLIBTOP-EXCLUDE-IDLE:CAPS"></a><h3>GLIBTOP_EXCLUDE_IDLE</h3>
242
<pre class="programlisting">#define GLIBTOP_EXCLUDE_IDLE 0x1000
244
<p>Exclude idle processes.</p>
247
<div class="refsect2">
248
<a name="GLIBTOP-EXCLUDE-SYSTEM:CAPS"></a><h3>GLIBTOP_EXCLUDE_SYSTEM</h3>
249
<pre class="programlisting">#define GLIBTOP_EXCLUDE_SYSTEM 0x2000
251
<p>Exclude system (on most UNIXes root's) processes.</p>
254
<div class="refsect2">
255
<a name="GLIBTOP-EXCLUDE-NOTTY:CAPS"></a><h3>GLIBTOP_EXCLUDE_NOTTY</h3>
256
<pre class="programlisting">#define GLIBTOP_EXCLUDE_NOTTY 0x4000
258
<p>Exclude processes without a controlling terminal.</p>
261
<div class="refsect2">
262
<a name="glibtop-proclist"></a><h3>struct glibtop_proclist</h3>
263
<pre class="programlisting">struct glibtop_proclist {
265
guint64 number; /* GLIBTOP_PROCLIST_NUMBER */
266
guint64 total; /* GLIBTOP_PROCLIST_TOTAL */
267
guint64 size; /* GLIBTOP_PROCLIST_SIZE */
270
<div class="refsect3">
271
<a name="id-1.3.28.10.13.4"></a><h4>Members</h4>
272
<div class="informaltable"><table width="100%" border="0">
274
<col width="300px" class="struct_members_name">
275
<col class="struct_members_description">
276
<col width="200px" class="struct_members_annotations">
280
<td class="struct_member_name"><p><span class="type">guint64</span> <em class="structfield"><code><a name="glibtop-proclist.flags"></a>flags</code></em>;</p></td>
281
<td class="struct_member_description"> </td>
282
<td class="struct_member_annotations"> </td>
285
<td class="struct_member_name"><p><span class="type">guint64</span> <em class="structfield"><code><a name="glibtop-proclist.number"></a>number</code></em>;</p></td>
286
<td class="struct_member_description"><p>Number of entries in the returned list.</p></td>
287
<td class="struct_member_annotations"> </td>
290
<td class="struct_member_name"><p><span class="type">guint64</span> <em class="structfield"><code><a name="glibtop-proclist.total"></a>total</code></em>;</p></td>
291
<td class="struct_member_description"><p>Total size of the returned list (this equals <em class="parameter"><code>number</code></em>
292
* <em class="parameter"><code>size</code></em>
294
<td class="struct_member_annotations"> </td>
297
<td class="struct_member_name"><p><span class="type">guint64</span> <em class="structfield"><code><a name="glibtop-proclist.size"></a>size</code></em>;</p></td>
298
<td class="struct_member_description"><p>Size of a single entry in the returned list
299
(this equals <span class="type">sizeof(unsigned)</span>).</p></td>
300
<td class="struct_member_annotations"> </td>
310
Generated by GTK-Doc V1.20</div>
b'\\ No newline at end of file'