1<?xml version='1.0'?>
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
5
6<refentry id="sd_bus_creds_get_pid" xmlns:xi="http://www.w3.org/2001/XInclude">
7
8  <refentryinfo>
9    <title>sd_bus_creds_get_pid</title>
10    <productname>systemd</productname>
11  </refentryinfo>
12
13  <refmeta>
14    <refentrytitle>sd_bus_creds_get_pid</refentrytitle>
15    <manvolnum>3</manvolnum>
16  </refmeta>
17
18  <refnamediv>
19    <refname>sd_bus_creds_get_pid</refname>
20    <refname>sd_bus_creds_get_ppid</refname>
21    <refname>sd_bus_creds_get_tid</refname>
22    <refname>sd_bus_creds_get_uid</refname>
23    <refname>sd_bus_creds_get_euid</refname>
24    <refname>sd_bus_creds_get_suid</refname>
25    <refname>sd_bus_creds_get_fsuid</refname>
26    <refname>sd_bus_creds_get_gid</refname>
27    <refname>sd_bus_creds_get_egid</refname>
28    <refname>sd_bus_creds_get_sgid</refname>
29    <refname>sd_bus_creds_get_fsgid</refname>
30    <refname>sd_bus_creds_get_supplementary_gids</refname>
31    <refname>sd_bus_creds_get_comm</refname>
32    <refname>sd_bus_creds_get_tid_comm</refname>
33    <refname>sd_bus_creds_get_exe</refname>
34    <refname>sd_bus_creds_get_cmdline</refname>
35    <refname>sd_bus_creds_get_cgroup</refname>
36    <refname>sd_bus_creds_get_unit</refname>
37    <refname>sd_bus_creds_get_slice</refname>
38    <refname>sd_bus_creds_get_user_unit</refname>
39    <refname>sd_bus_creds_get_user_slice</refname>
40    <refname>sd_bus_creds_get_session</refname>
41    <refname>sd_bus_creds_get_owner_uid</refname>
42    <refname>sd_bus_creds_has_effective_cap</refname>
43    <refname>sd_bus_creds_has_permitted_cap</refname>
44    <refname>sd_bus_creds_has_inheritable_cap</refname>
45    <refname>sd_bus_creds_has_bounding_cap</refname>
46    <refname>sd_bus_creds_get_selinux_context</refname>
47    <refname>sd_bus_creds_get_audit_session_id</refname>
48    <refname>sd_bus_creds_get_audit_login_uid</refname>
49    <refname>sd_bus_creds_get_tty</refname>
50    <refname>sd_bus_creds_get_unique_name</refname>
51    <refname>sd_bus_creds_get_well_known_names</refname>
52    <refname>sd_bus_creds_get_description</refname>
53
54    <refpurpose>Retrieve fields from a credentials object</refpurpose>
55  </refnamediv>
56
57  <refsynopsisdiv>
58    <funcsynopsis>
59      <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
60
61      <funcprototype>
62        <funcdef>int <function>sd_bus_creds_get_pid</function></funcdef>
63        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
64        <paramdef>pid_t *<parameter>pid</parameter></paramdef>
65      </funcprototype>
66
67      <funcprototype>
68        <funcdef>int <function>sd_bus_creds_get_ppid</function></funcdef>
69        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
70        <paramdef>pid_t *<parameter>ppid</parameter></paramdef>
71      </funcprototype>
72
73      <funcprototype>
74        <funcdef>int <function>sd_bus_creds_get_tid</function></funcdef>
75        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
76        <paramdef>pid_t *<parameter>tid</parameter></paramdef>
77      </funcprototype>
78
79      <funcprototype>
80        <funcdef>int <function>sd_bus_creds_get_uid</function></funcdef>
81        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
82        <paramdef>uid_t *<parameter>uid</parameter></paramdef>
83      </funcprototype>
84
85      <funcprototype>
86        <funcdef>int <function>sd_bus_creds_get_euid</function></funcdef>
87        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
88        <paramdef>uid_t *<parameter>uid</parameter></paramdef>
89      </funcprototype>
90
91      <funcprototype>
92        <funcdef>int <function>sd_bus_creds_get_suid</function></funcdef>
93        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
94        <paramdef>uid_t *<parameter>uid</parameter></paramdef>
95      </funcprototype>
96
97      <funcprototype>
98        <funcdef>int <function>sd_bus_creds_get_fsuid</function></funcdef>
99        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
100        <paramdef>uid_t *<parameter>uid</parameter></paramdef>
101      </funcprototype>
102
103      <funcprototype>
104        <funcdef>int <function>sd_bus_creds_get_gid</function></funcdef>
105        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
106        <paramdef>gid_t *<parameter>gid</parameter></paramdef>
107      </funcprototype>
108
109      <funcprototype>
110        <funcdef>int <function>sd_bus_creds_get_egid</function></funcdef>
111        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
112        <paramdef>gid_t *<parameter>gid</parameter></paramdef>
113      </funcprototype>
114
115      <funcprototype>
116        <funcdef>int <function>sd_bus_creds_get_sgid</function></funcdef>
117        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
118        <paramdef>gid_t *<parameter>gid</parameter></paramdef>
119      </funcprototype>
120
121      <funcprototype>
122        <funcdef>int <function>sd_bus_creds_get_fsgid</function></funcdef>
123        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
124        <paramdef>gid_t *<parameter>gid</parameter></paramdef>
125      </funcprototype>
126
127      <funcprototype>
128        <funcdef>int <function>sd_bus_creds_get_supplementary_gids</function></funcdef>
129        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
130        <paramdef>const gid_t **<parameter>gids</parameter></paramdef>
131      </funcprototype>
132
133      <funcprototype>
134        <funcdef>int <function>sd_bus_creds_get_comm</function></funcdef>
135        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
136        <paramdef>const char **<parameter>comm</parameter></paramdef>
137      </funcprototype>
138
139      <funcprototype>
140        <funcdef>int <function>sd_bus_creds_get_tid_comm</function></funcdef>
141        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
142        <paramdef>const char **<parameter>comm</parameter></paramdef>
143      </funcprototype>
144
145      <funcprototype>
146        <funcdef>int <function>sd_bus_creds_get_exe</function></funcdef>
147        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
148        <paramdef>const char **<parameter>exe</parameter></paramdef>
149      </funcprototype>
150
151      <funcprototype>
152        <funcdef>int <function>sd_bus_creds_get_cmdline</function></funcdef>
153        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
154        <paramdef>char ***<parameter>cmdline</parameter></paramdef>
155      </funcprototype>
156
157      <funcprototype>
158        <funcdef>int <function>sd_bus_creds_get_cgroup</function></funcdef>
159        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
160        <paramdef>const char **<parameter>cgroup</parameter></paramdef>
161      </funcprototype>
162
163      <funcprototype>
164        <funcdef>int <function>sd_bus_creds_get_unit</function></funcdef>
165        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
166        <paramdef>const char **<parameter>unit</parameter></paramdef>
167      </funcprototype>
168
169      <funcprototype>
170        <funcdef>int <function>sd_bus_creds_get_slice</function></funcdef>
171        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
172        <paramdef>const char **<parameter>slice</parameter></paramdef>
173      </funcprototype>
174
175      <funcprototype>
176        <funcdef>int <function>sd_bus_creds_get_user_unit</function></funcdef>
177        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
178        <paramdef>const char **<parameter>unit</parameter></paramdef>
179      </funcprototype>
180
181      <funcprototype>
182        <funcdef>int <function>sd_bus_creds_get_user_slice</function></funcdef>
183        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
184        <paramdef>const char **<parameter>slice</parameter></paramdef>
185      </funcprototype>
186
187      <funcprototype>
188        <funcdef>int <function>sd_bus_creds_get_session</function></funcdef>
189        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
190        <paramdef>const char **<parameter>slice</parameter></paramdef>
191      </funcprototype>
192
193      <funcprototype>
194        <funcdef>int <function>sd_bus_creds_get_owner_uid</function></funcdef>
195        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
196        <paramdef>uid_t *<parameter>uid</parameter></paramdef>
197      </funcprototype>
198
199      <funcprototype>
200        <funcdef>int <function>sd_bus_creds_has_effective_cap</function></funcdef>
201        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
202        <paramdef>int <parameter>capability</parameter></paramdef>
203      </funcprototype>
204
205      <funcprototype>
206        <funcdef>int <function>sd_bus_creds_has_permitted_cap</function></funcdef>
207        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
208        <paramdef>int <parameter>capability</parameter></paramdef>
209      </funcprototype>
210
211      <funcprototype>
212        <funcdef>int <function>sd_bus_creds_has_inheritable_cap</function></funcdef>
213        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
214        <paramdef>int <parameter>capability</parameter></paramdef>
215      </funcprototype>
216
217      <funcprototype>
218        <funcdef>int <function>sd_bus_creds_has_bounding_cap</function></funcdef>
219        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
220        <paramdef>int <parameter>capability</parameter></paramdef>
221      </funcprototype>
222
223      <funcprototype>
224        <funcdef>int <function>sd_bus_creds_get_selinux_context</function></funcdef>
225        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
226        <paramdef>const char **<parameter>context</parameter></paramdef>
227      </funcprototype>
228
229      <funcprototype>
230        <funcdef>int <function>sd_bus_creds_get_audit_session_id</function></funcdef>
231        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
232        <paramdef>uint32_t *<parameter>sessionid</parameter></paramdef>
233      </funcprototype>
234
235      <funcprototype>
236        <funcdef>int <function>sd_bus_creds_get_audit_login_uid</function></funcdef>
237        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
238        <paramdef>uid_t *<parameter>loginuid</parameter></paramdef>
239      </funcprototype>
240
241      <funcprototype>
242        <funcdef>int <function>sd_bus_creds_get_tty</function></funcdef>
243        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
244        <paramdef>const char **<parameter>tty</parameter></paramdef>
245      </funcprototype>
246
247      <funcprototype>
248        <funcdef>int <function>sd_bus_creds_get_unique_name</function></funcdef>
249        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
250        <paramdef>const char **<parameter>name</parameter></paramdef>
251      </funcprototype>
252
253      <funcprototype>
254        <funcdef>int <function>sd_bus_creds_get_well_known_names</function></funcdef>
255        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
256        <paramdef>char ***<parameter>name</parameter></paramdef>
257      </funcprototype>
258
259      <funcprototype>
260        <funcdef>int <function>sd_bus_creds_get_description</function></funcdef>
261        <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
262        <paramdef>const char **<parameter>name</parameter></paramdef>
263      </funcprototype>
264
265    </funcsynopsis>
266  </refsynopsisdiv>
267
268  <refsect1>
269    <title>Description</title>
270
271    <para>These functions return credential information from an
272    <parameter>sd_bus_creds</parameter> object. Credential objects may
273    be created with
274    <citerefentry><refentrytitle>sd_bus_creds_new_from_pid</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
275    in which case they describe the credentials of the process
276    identified by the specified PID, with
277    <citerefentry><refentrytitle>sd_bus_get_name_creds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
278    in which case they describe the credentials of a bus peer
279    identified by the specified bus name, with
280    <citerefentry><refentrytitle>sd_bus_get_owner_creds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
281    in which case they describe the credentials of the creator of a
282    bus, or with
283    <citerefentry><refentrytitle>sd_bus_message_get_creds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
284    in which case they describe the credentials of the sender of the
285    message.</para>
286
287    <para>Not all credential fields are part of every
288    <literal>sd_bus_creds</literal> object. Use
289    <citerefentry><refentrytitle>sd_bus_creds_get_mask</refentrytitle><manvolnum>3</manvolnum></citerefentry>
290    to determine the mask of fields available.</para>
291
292    <para><function>sd_bus_creds_get_pid()</function> will retrieve
293    the PID (process identifier). Similarly,
294    <function>sd_bus_creds_get_ppid()</function> will retrieve the
295    parent PID. Note that PID 1 has no parent process, in which case
296    -ENXIO is returned.</para>
297
298    <para><function>sd_bus_creds_get_tid()</function> will retrieve the
299    TID (thread identifier).</para>
300
301    <para><function>sd_bus_creds_get_uid()</function> will retrieve
302    the numeric UID (user identifier). Similarly,
303    <function>sd_bus_creds_get_euid()</function> returns the effective
304    UID, <function>sd_bus_creds_get_suid()</function> the saved UID
305    and <function>sd_bus_creds_get_fsuid()</function> the file system
306    UID.</para>
307
308    <para><function>sd_bus_creds_get_gid()</function> will retrieve the
309    numeric GID (group identifier). Similarly,
310    <function>sd_bus_creds_get_egid()</function> returns the effective
311    GID, <function>sd_bus_creds_get_sgid()</function> the saved GID
312    and <function>sd_bus_creds_get_fsgid()</function> the file system
313    GID.</para>
314
315    <para><function>sd_bus_creds_get_supplementary_gids()</function>
316    will retrieve the supplementary GIDs list.</para>
317
318    <para><function>sd_bus_creds_get_comm()</function> will retrieve the
319    comm field (truncated name of the executable, as stored in
320    <filename>/proc/<replaceable>pid</replaceable>/comm</filename>).
321    </para>
322
323    <para><function>sd_bus_creds_get_tid_comm()</function> will retrieve
324    the comm field of the thread (as stored in
325    <filename>/proc/<replaceable>pid</replaceable>/task/<replaceable>tid</replaceable>/comm</filename>).
326    </para>
327
328    <para><function>sd_bus_creds_get_exe()</function> will retrieve the path to the program executable (as
329    stored in the <filename>/proc/<replaceable>pid</replaceable>/exe</filename> link, but with the <literal>
330    (deleted)</literal> suffix removed). Note that kernel threads do not have an executable path, in which
331    case -ENXIO is returned. Note that this property should not be used for more than explanatory
332    information, in particular it should not be used for security-relevant decisions. That's because the
333    executable might have been replaced or removed by the time the value can be processed. Moreover, the
334    kernel exports this information in an ambiguous way (i.e. a deleted executable cannot be safely
335    distinguished from one whose name suffix is <literal> (deleted)</literal>).</para>
336
337    <para><function>sd_bus_creds_get_cmdline()</function> will
338    retrieve an array of command line arguments (as stored in
339    <filename>/proc/<replaceable>pid</replaceable>/cmdline</filename>). Note
340    that kernel threads do not have a command line, in which case
341    -ENXIO is returned.</para>
342
343    <para><function>sd_bus_creds_get_cgroup()</function> will retrieve
344    the control group path. See <ulink
345    url="https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt">cgroups.txt</ulink>.
346    </para>
347
348    <para><function>sd_bus_creds_get_unit()</function> will retrieve
349    the systemd unit name (in the system instance of systemd) that the
350    process is a part of. See
351    <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. For
352    processes that are not part of a unit, returns -ENXIO.
353    </para>
354
355    <para><function>sd_bus_creds_get_user_unit()</function> will
356    retrieve the systemd unit name (in the user instance of systemd)
357    that the process is a part of. See
358    <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. For
359    processes that are not part of a user unit, returns -ENXIO.
360    </para>
361
362    <para><function>sd_bus_creds_get_slice()</function> will retrieve
363    the systemd slice (a unit in the system instance of systemd) that
364    the process is a part of. See
365    <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Similarly,
366    <function>sd_bus_creds_get_user_slice()</function> retrieves the
367    systemd slice of the process, in the user instance of systemd.
368    </para>
369
370    <para><function>sd_bus_creds_get_session()</function> will
371    retrieve the identifier of the login session that the process is
372    a part of. Please note the login session may be limited to a stub
373    process or two.  User processes may instead be started from their
374    systemd user manager, e.g. GUI applications started using DBus
375    activation, as well as service processes which are shared between
376    multiple logins of the same user. For processes that are not part
377    of a session, returns -ENXIO.</para>
378
379    <para><function>sd_bus_creds_get_owner_uid()</function> will
380    retrieve the numeric UID (user identifier) of the user who owns
381    the user unit or login session that the process is a part of. See
382    <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
383    For processes that are not part of a user unit or session, returns
384    -ENXIO.
385    </para>
386
387    <para><function>sd_bus_creds_has_effective_cap()</function> will check whether the capability specified by
388    <parameter>capability</parameter> was set in the effective capabilities mask. A positive return value means that it
389    was set, zero means that it was not set, and a negative return value indicates an error. See <citerefentry
390    project='man-pages'><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry> and the
391    <varname>AmbientCapabilities=</varname> and <varname>CapabilityBoundingSet=</varname> settings in
392    <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
393    </para>
394
395    <para><function>sd_bus_creds_has_permitted_cap()</function> is
396    similar to <function>sd_bus_creds_has_effective_cap()</function>,
397    but will check the permitted capabilities mask.</para>
398
399    <para><function>sd_bus_creds_has_inheritable_cap()</function> is
400    similar to <function>sd_bus_creds_has_effective_cap()</function>,
401    but will check the inheritable capabilities mask.</para>
402
403    <para><function>sd_bus_creds_has_bounding_cap()</function> is
404    similar to <function>sd_bus_creds_has_effective_cap()</function>,
405    but will check the bounding capabilities mask.</para>
406
407    <para><function>sd_bus_creds_get_selinux_context()</function> will
408    retrieve the SELinux security context (label) of the process.</para>
409
410    <para><function>sd_bus_creds_get_audit_session_id()</function>
411    will retrieve the audit session identifier of the process. Returns
412    -ENXIO for processes that are not part of an audit session.</para>
413
414    <para><function>sd_bus_creds_get_audit_login_uid()</function> will
415    retrieve the audit user login identifier (the identifier of the
416    user who is "responsible" for the session). Returns -ENXIO for
417    processes that are not part of an audit session.</para>
418
419    <para><function>sd_bus_creds_get_tty()</function> will retrieve
420    the controlling TTY, without the prefixing "/dev/". Returns -ENXIO
421    for processes that have no controlling TTY.</para>
422
423    <para><function>sd_bus_creds_get_unique_name()</function> will
424    retrieve the D-Bus unique name. See <ulink
425    url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-bus">The
426    D-Bus specification</ulink>.</para>
427
428    <para><function>sd_bus_creds_get_well_known_names()</function> will
429    retrieve the set of D-Bus well-known names. See <ulink
430    url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-bus">The
431    D-Bus specification</ulink>.</para>
432
433    <para><function>sd_bus_creds_get_description()</function> will
434    retrieve a descriptive name of the bus connection of the
435    peer. This name is useful to discern multiple bus connections by
436    the same peer, and may be altered by the peer with the
437    <citerefentry><refentrytitle>sd_bus_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>
438    call.</para>
439
440    <para>All functions that take a <parameter>const
441    char**</parameter> parameter will store the answer there as an
442    address of a <constant>NUL</constant>-terminated string. It will be valid as long as
443    <parameter>c</parameter> remains valid, and should not be freed or
444    modified by the caller.</para>
445
446    <para>All functions that take a <parameter>char***</parameter>
447    parameter will store the answer there as an address of an array
448    of strings. Each individual string is <constant>NUL</constant>-terminated, and the
449    array is <constant>NULL</constant>-terminated as a whole. It will be valid as long as
450    <parameter>c</parameter> remains valid, and should not be freed or
451    modified by the caller.</para>
452  </refsect1>
453
454  <refsect1>
455    <title>Return Value</title>
456
457    <para>On success, these calls return 0 or a positive integer. On
458    failure, these calls return a negative errno-style error code.
459    </para>
460
461    <refsect2>
462      <title>Errors</title>
463
464      <para>Returned errors may indicate the following problems:</para>
465
466      <variablelist>
467        <varlistentry>
468          <term><constant>-ENODATA</constant></term>
469
470          <listitem><para>The given field is not available in the credentials object
471          <parameter>c</parameter>.</para>
472          </listitem>
473        </varlistentry>
474
475        <varlistentry>
476          <term><constant>-ENXIO</constant></term>
477
478          <listitem><para>The given field is not specified for the described process or peer. This will be
479          returned by <function>sd_bus_creds_get_unit()</function>,
480          <function>sd_bus_creds_get_slice()</function>, <function>sd_bus_creds_get_user_unit()</function>,
481          <function>sd_bus_creds_get_user_slice()</function>, and
482          <function>sd_bus_creds_get_session()</function> if the process is not part of a systemd system
483          unit, systemd user unit, systemd slice, or logind session. It will be returned by
484          <function>sd_bus_creds_get_owner_uid()</function> if the process is not part of a systemd user unit
485          or logind session. It will also be returned by <function>sd_bus_creds_get_exe()</function> and
486          <function>sd_bus_creds_get_cmdline()</function> for kernel threads (since these are not started
487          from an executable binary, nor have a command line), and by
488          <function>sd_bus_creds_get_audit_session_id()</function> and
489          <function>sd_bus_creds_get_audit_login_uid()</function> when the process is not part of an audit
490          session, and <function>sd_bus_creds_get_tty()</function> if the process has no controlling
491          TTY.</para></listitem>
492        </varlistentry>
493
494        <varlistentry>
495          <term><constant>-EINVAL</constant></term>
496
497          <listitem><para>Specified pointer parameter is <constant>NULL</constant>.</para></listitem>
498        </varlistentry>
499
500        <varlistentry>
501          <term><constant>-ENOMEM</constant></term>
502
503          <listitem><para>Memory allocation failed.</para></listitem>
504        </varlistentry>
505      </variablelist>
506    </refsect2>
507  </refsect1>
508
509  <xi:include href="libsystemd-pkgconfig.xml" />
510
511  <refsect1>
512    <title>See Also</title>
513
514    <para>
515      <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
516      <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
517      <citerefentry><refentrytitle>sd_bus_creds_new_from_pid</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
518      <citerefentry project='man-pages'><refentrytitle>fork</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
519      <citerefentry project='man-pages'><refentrytitle>execve</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
520      <citerefentry project='man-pages'><refentrytitle>credentials</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
521      <citerefentry project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
522      <citerefentry project='man-pages'><refentrytitle>proc</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
523      <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>
524    </para>
525  </refsect1>
526
527</refentry>
528