summaryrefslogtreecommitdiff
path: root/man/sd_pid_get_session.xml
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-04 09:05:52 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-04 09:07:31 +0200
commit707b66c66381c899d7ef640e158ffdd5bcff4deb (patch)
tree904cc3ecb07281497e16a0097d89286f84067225 /man/sd_pid_get_session.xml
parent9da4cb2be260ed123f2676cb85cb350c527b1492 (diff)
sd-login: rework error handling
Makre sure we always return sensible errors for the various, following the same rules, and document them in a comment in sd-login.c. Also, update all relevant man pages accordingly.
Diffstat (limited to 'man/sd_pid_get_session.xml')
-rw-r--r--man/sd_pid_get_session.xml38
1 files changed, 26 insertions, 12 deletions
diff --git a/man/sd_pid_get_session.xml b/man/sd_pid_get_session.xml
index 9c6706caf8..903c143f36 100644
--- a/man/sd_pid_get_session.xml
+++ b/man/sd_pid_get_session.xml
@@ -1,4 +1,4 @@
-<?xml version='1.0'?> <!--*-nxml-*-->
+<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
@@ -163,7 +163,7 @@
processes, user processes that are shared between multiple
sessions of the same user, or kernel threads). For processes not
being part of a login session this function will fail with
- -ENXIO. The returned string needs to be freed with the libc
+ -ENODATA. The returned string needs to be freed with the libc
<citerefentry
project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
call after use.</para>
@@ -175,9 +175,9 @@
paths. Note that not all processes are part of a system
unit/service (e.g. user processes, or kernel threads). For
processes not being part of a systemd system unit this function
- will fail with -ENXIO (More specifically: this call will not work
- for kernel threads.) The returned string needs to be freed with
- the libc <citerefentry
+ will fail with -ENODATA (More specifically: this call will not
+ work for kernel threads.) The returned string needs to be freed
+ with the libc <citerefentry
project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
call after use.</para>
@@ -194,7 +194,7 @@
multiple login sessions of the same user, where
<function>sd_pid_get_session()</function> will fail. For processes
not being part of a login session and not being a shared process
- of a user this function will fail with -ENXIO.</para>
+ of a user this function will fail with -ENODATA.</para>
<para><function>sd_pid_get_machine_name()</function> may be used
to determine the name of the VM or container is a member of. The
@@ -203,7 +203,7 @@
<citerefentry
project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
call after use. For processes not part of a VM or containers this
- function fails with -ENXIO.</para>
+ function fails with -ENODATA.</para>
<para><function>sd_pid_get_slice()</function> may be used to
determine the slice unit the process is a member of. See
@@ -251,7 +251,22 @@
<variablelist>
<varlistentry>
- <term><constant>-ENXIO</constant></term>
+ <term><constant>-ESRCH</constant></term>
+
+ <listitem><para>The specified PID does not refer to a running
+ process.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><constant>-BADF</constant></term>
+
+ <listitem><para>The specified socket file descriptor was
+ invalid.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><constant>-ENODATA</constant></term>
<listitem><para>Given field is not specified for the described
process or peer.</para>
@@ -259,11 +274,10 @@
</varlistentry>
<varlistentry>
- <term><constant>-ESRCH</constant></term>
+ <term><constant>-EINVAL</constant></term>
- <listitem><para>The specified PID does not refer to a running
- process.</para>
- </listitem>
+ <listitem><para>An input parameter was invalid (out of range,
+ or NULL, where that's not accepted).</para></listitem>
</varlistentry>
<varlistentry>