1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-12 13:18:14 +03:00

Merge pull request #7969 from poettering/stream-fd

man: minor improvements regarding journal API descriptions
This commit is contained in:
Lennart Poettering 2018-01-23 19:41:57 +01:00 committed by GitHub
commit fb12972d4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 11 deletions

View File

@ -233,12 +233,12 @@ else {
<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>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-safety</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>

View File

@ -205,8 +205,8 @@ sd_journal_send("MESSAGE=Hello World, this is PID %lu!", (unsigned long) getpid(
<title>Thread safety</title>
<para>All functions listed here are thread-safe and may be called in parallel from multiple threads.</para>
<para><function>sd_journal_sendv()</function> is "async signal safe" in the meaning of
<citerefentry project='man-pages'><refentrytitle>signal</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
<para><function>sd_journal_sendv()</function> is "async signal safe" in the meaning of <citerefentry
project='man-pages'><refentrytitle>signal-safety</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
</para>
<para><function>sd_journal_print</function>,

View File

@ -94,6 +94,10 @@
<para>It is recommended that applications log UTF-8 messages only
with this API, but this is not enforced.</para>
<para>Each invocation of <function>sd_journal_stream_fd()</function> allocates a new log stream file descriptor,
that is not shared with prior or later invocations. The file descriptor is write-only (its reading direction is
shut down), and <constant>O_NONBLOCK</constant> is turned off initially.</para>
</refsect1>
<refsect1>
@ -106,8 +110,8 @@
<refsect1>
<title>Signal safety</title>
<para><function>sd_journal_stream_fd()</function> is "async signal safe" in the meaning of
<citerefentry project='man-pages'><refentrytitle>signal</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
<para><function>sd_journal_stream_fd()</function> is "async signal safe" in the meaning of <citerefentry
project='man-pages'><refentrytitle>signal-safety</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
</para>
</refsect1>

View File

@ -416,7 +416,7 @@ _public_ int sd_journal_stream_fd(const char *identifier, int priority, int leve
if (shutdown(fd, SHUT_RD) < 0)
return -errno;
fd_inc_sndbuf(fd, SNDBUF_SIZE);
(void) fd_inc_sndbuf(fd, SNDBUF_SIZE);
identifier = strempty(identifier);