1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-10 01:17:44 +03:00

Merge pull request #7938 from keszybz/get-fd-unsafe

man: document signal unsafeness of sd_journal_get_fd
This commit is contained in:
Yu Watanabe 2018-01-20 13:20:33 +09:00 committed by GitHub
commit 08fde561ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

2
NEWS
View File

@ -5321,7 +5321,7 @@ CHANGES WITH 209:
option as supported by Debian is added. It allows indicating
which LUKS slot to use on disk, speeding up key loading.
* The sd_journald_sendv() API call has been checked and
* The sd_journal_sendv() API call has been checked and
officially declared to be async-signal-safe so that it may
be invoked from signal handlers for logging purposes.

View File

@ -230,6 +230,20 @@ else {
journal.</para>
</refsect1>
<refsect1>
<title>Signal safety</title>
<para>In general, <function>sd_journal_get_fd()</function>,
<function>sd_journal_get_events()</function>, and <function>sd_journal_get_timeout()</function>
are <emphasis>not</emphasis> "async signal safe" in the meaning of
<citerefentry project='man-pages'><refentrytitle>signal</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
Nevertheless, only the first call to any of those three functions performs unsafe operations, so
subsequent calls <emphasis>are</emphasis> safe.</para>
<para><function>sd_journal_process()</function> and <function>sd_journal_wait()</function> are not
safe. <function>sd_journal_reliable_fd()</function> is safe.</para>
</refsect1>
<refsect1>
<title>Notes</title>