sd_bus_creds_new_from_pid.xml revision 3802a3d3d7af51ddff31943d5514382f01265770
3802a3d3d7af51ddff31943d5514382f01265770Lennart Poettering<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-SzmekThis file is part of systemd.
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-SzmekCopyright 2014 Zbigniew Jędrzejewski-Szmek
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmeksystemd is free software; you can redistribute it and/or modify it
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmekunder the terms of the GNU Lesser General Public License as published by
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmekthe Free Software Foundation; either version 2.1 of the License, or
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek(at your option) any later version.
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmeksystemd is distributed in the hope that it will be useful, but
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-SzmekWITHOUT ANY WARRANTY; without even the implied warranty of
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-SzmekMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-SzmekLesser General Public License for more details.
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-SzmekYou should have received a copy of the GNU Lesser General Public License
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmekalong with systemd; If not, see <http://www.gnu.org/licenses/>.
7c071fda945a8f9e3b11d37dc04c8bdfa615d44aZbigniew Jędrzejewski-Szmek<refentry id="sd_bus_creds_new_from_pid" conditional="ENABLE_KDBUS">
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <title>sd_bus_creds_new_from_pid</title>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <productname>systemd</productname>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <contrib>A monkey with a typewriter</contrib>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <surname>Jędrzejewski-Szmek</surname>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <email>zbyszek@in.waw.pl</email>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <refentrytitle>sd_bus_creds_new_from_pid</refentrytitle>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <refname>sd_bus_creds_new_from_pid</refname>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <refname>sd_bus_creds_get_mask</refname>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <refname>sd_bus_creds_ref</refname>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <refname>sd_bus_creds_unref</refname>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <refpurpose>Retrieve credentials object for the specified PID</refpurpose>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <refsynopsisdiv>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <funcdef>int <function>sd_bus_creds_new_from_pid</function></funcdef>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <paramdef>pid_t <parameter>pid</parameter></paramdef>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <paramdef>uint64_t <parameter>creds_mask</parameter></paramdef>
8dc385e7701726be69b681e2738a1d74a21b24f1Jan Engelhardt <paramdef>sd_bus_creds **<parameter>ret</parameter></paramdef>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek </funcprototype>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <funcdef>uint64_t <function>sd_bus_creds_get_mask</function></funcdef>
8dc385e7701726be69b681e2738a1d74a21b24f1Jan Engelhardt <paramdef>const sd_bus_creds *<parameter>c</parameter></paramdef>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek </funcprototype>
8dc385e7701726be69b681e2738a1d74a21b24f1Jan Engelhardt <funcdef>sd_bus_creds *<function>sd_bus_creds_ref</function></funcdef>
8dc385e7701726be69b681e2738a1d74a21b24f1Jan Engelhardt <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek </funcprototype>
8dc385e7701726be69b681e2738a1d74a21b24f1Jan Engelhardt <funcdef>sd_bus_creds *<function>sd_bus_creds_unref</function></funcdef>
8dc385e7701726be69b681e2738a1d74a21b24f1Jan Engelhardt <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek </funcprototype>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_PID</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_PID_STARTTIME</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_TID</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_UID</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_GID</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_COMM</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_TID_COMM</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_EXE</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_CMDLINE</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_CGROUP</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_UNIT</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_USER_UNIT</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_SLICE</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_SESSION</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_OWNER_UID</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_EFFECTIVE_CAPS</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_PERMITTED_CAPS</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_INHERITABLE_CAPS</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_BOUNDING_CAPS</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_SELINUX_CONTEXT</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_AUDIT_SESSION_ID</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_AUDIT_LOGIN_UID</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_UNIQUE_NAME</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_WELL_KNOWN_NAMES</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>_SD_BUS_CREDS_ALL</constant>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek </refsynopsisdiv>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <para><function>sd_bus_creds_new_from_pid()</function> creates a new
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek credentials object and fills it with information about the process
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <parameter>pid</parameter>. This pointer to this object will
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek be stored in <parameter>ret</parameter> pointer.</para>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <para>The information that will be stored is determined by
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <parameter>creds_mask</parameter>. It may contain a subset of ORed
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek constants <constant>SD_BUS_CREDS_PID</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_PID_STARTTIME</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_TID</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_UID</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_GID</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_COMM</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_TID_COMM</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_EXE</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_CMDLINE</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_CGROUP</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_UNIT</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_USER_UNIT</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_SLICE</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_SESSION</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_OWNER_UID</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_EFFECTIVE_CAPS</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_PERMITTED_CAPS</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_INHERITABLE_CAPS</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_BOUNDING_CAPS</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_SELINUX_CONTEXT</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_AUDIT_SESSION_ID</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_AUDIT_LOGIN_UID</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_UNIQUE_NAME</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>SD_BUS_CREDS_WELL_KNOWN_NAMES</constant>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek or <constant>_SD_BUS_CREDS_ALL</constant> to indicate
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek all known fields.</para>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <para>Fields can be retrieved from the credentials object using
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_pid</refentrytitle><manvolnum>3</manvolnum></citerefentry>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek and other functions which correspond directly to the constants
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek listed above.</para>
06b643e7f5a3b79005dd57497897ab7255fe3659Ruben Kerkhof <para>A mask of fields which were actually successfully set
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek (acquired from <filename>/proc</filename>, etc.) can be retrieved
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek with <function>sd_bus_creds_get_mask()</function>. If the
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek credentials object was created with
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <function>sd_bus_creds_new_from_pid()</function>, this will be a
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek subset of fields requested in <parameter>creds_mask</parameter>.
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <para><function>sd_bus_creds_ref</function> creates a new
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek reference to the credentials object <parameter>c</parameter>. This
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek object will not be destroyed until
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <function>sd_bus_creds_unref</function> has been called as many
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek times plus once more. Once the reference count has dropped to zero,
06b643e7f5a3b79005dd57497897ab7255fe3659Ruben Kerkhof <parameter>c</parameter> cannot be used anymore, so further
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek calls to <function>sd_bus_creds_ref(c)</function> or
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <function>sd_bus_creds_unref(c)</function> are illegal.</para>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <para><function>sd_bus_creds_unref</function> destroys a reference
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek to <parameter>c</parameter>.</para>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <para>On success, <function>sd_bus_creds_new_from_pid()</function>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek returns 0 or a positive integer. On failure, it returns a negative
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek errno-style error code.</para>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <para><function>sd_bus_creds_get_mask()</function> returns the
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek mask of successfully acquired fields.</para>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <para><function>sd_bus_creds_ref</function> always returns the
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek argument.</para>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <para><function>sd_bus_creds_unref</function> always returns
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <constant>NULL</constant>.</para>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <title>Reference ownership</title>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <para>Function <function>sd_bus_creds_new_from_pid()</function>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek creates a new object and the caller owns the sole reference. When
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek not needed anymore, this reference should be destroyed with
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <para>Returned errors may indicate the following problems:</para>
8474b70c3a3842cdf3d51f331dd117ab6421f6d0Zbigniew Jędrzejewski-Szmek <term><constant>-ESRCH</constant></term>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <listitem><para>Specified <parameter>pid</parameter> could not
8474b70c3a3842cdf3d51f331dd117ab6421f6d0Zbigniew Jędrzejewski-Szmek <term><constant>-EINVAL</constant></term>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <listitem><para>Specified parameter is invalid
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek (<constant>NULL</constant> in case of output
8474b70c3a3842cdf3d51f331dd117ab6421f6d0Zbigniew Jędrzejewski-Szmek <term><constant>-ENOMEM</constant></term>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <listitem><para>Memory allocation failed.</para></listitem>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <para><function>sd_bus_creds_new_from_pid()</function> is
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek available as a shared library, which can be compiled and linked to
5aded369782f28255bc6b494ca905d7acaea7a56Zbigniew Jędrzejewski-Szmek <constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_ref</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_pid</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_pid_starttime</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_tid</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_uid</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_gid</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_comm</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_tid_comm</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_exe</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_cmdline</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_cgroup</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_unit</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_user_unit</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_slice</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_session</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_owner_uid</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_has_effective_cap</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_has_permitted_cap</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_has_inheritable_cap</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_has_bounding_cap</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_selinux_context</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_audit_session_id</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_audit_login_uid</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_unique_name</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
4cf8496d0a5e85ec7610d166c5d35df3e6d02d1aZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>sd_bus_creds_get_well_known_names</refentrytitle><manvolnum>3</manvolnum></citerefentry>