diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2015-09-05 15:20:21 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2015-09-05 15:20:21 +0200 |
commit | 17258f5f27dd3dd57c36f2805e0a0c27a1aeabba (patch) | |
tree | 4777f9f0fc2863380467f900887697e09c07272d /man/sd_login_monitor_new.xml | |
parent | c7430c3d1a0c14aed631864b9da504ba1a9352c2 (diff) | |
parent | a67c56bff419afc16547f16df1ad1bbe0efe84a6 (diff) |
Merge pull request #1140 from poettering/sd-event-signals
A variety of sd-event, sd-login and cgroup fixes
Diffstat (limited to 'man/sd_login_monitor_new.xml')
-rw-r--r-- | man/sd_login_monitor_new.xml | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/man/sd_login_monitor_new.xml b/man/sd_login_monitor_new.xml index a7b47a3207..a8854dd590 100644 --- a/man/sd_login_monitor_new.xml +++ b/man/sd_login_monitor_new.xml @@ -161,20 +161,20 @@ is no timeout to wait for this will fill in <constant>(uint64_t) -1</constant> instead. Note that <function>poll()</function> takes a relative timeout in milliseconds rather than an absolute timeout - in microseconds. To convert the absolute 'us' timeout into + in microseconds. To convert the absolute 'µs' timeout into relative 'ms', use code like the following:</para> <programlisting>uint64_t t; int msec; sd_login_monitor_get_timeout(m, &t); if (t == (uint64_t) -1) - msec = -1; + msec = -1; else { - struct timespec ts; - uint64_t n; - clock_getttime(CLOCK_MONOTONIC, &ts); - n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000; - msec = t > n ? (int) ((t - n + 999) / 1000) : 0; + struct timespec ts; + uint64_t n; + clock_getttime(CLOCK_MONOTONIC, &ts); + n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000; + msec = t > n ? (int) ((t - n + 999) / 1000) : 0; }</programlisting> <para>The code above does not do any error checking for brevity's @@ -204,6 +204,29 @@ else { </refsect1> <refsect1> + <title>Errors</title> + + <para>Returned errors may indicate the following problems:</para> + + <variablelist> + + <varlistentry> + <term><constant>-EINVAL</constant></term> + + <listitem><para>An input parameter was invalid (out of range, + or NULL, where that's not accepted). The specified category to + watch is not known.</para></listitem> + </varlistentry> + + <varlistentry> + <term><constant>-ENOMEM</constant></term> + + <listitem><para>Memory allocation failed.</para></listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> <title>Notes</title> <para>The <function>sd_login_monitor_new()</function>, |