From 91a031725396faebf51ea7b5475532453b8d6df3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 13 Jul 2012 21:04:38 +0200 Subject: man: forgot sd_journal_get_fd() man page --- man/sd_journal_get_fd.xml | 160 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 man/sd_journal_get_fd.xml diff --git a/man/sd_journal_get_fd.xml b/man/sd_journal_get_fd.xml new file mode 100644 index 0000000000..f4db2a392a --- /dev/null +++ b/man/sd_journal_get_fd.xml @@ -0,0 +1,160 @@ + + + + + + + + + sd_journal_get_fd + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sd_journal_get_fd + 3 + + + + sd_journal_get_fd + sd_journal_get_process + sd_journal_get_wait + Journal change notification + interface + + + + + #include <systemd/sd-journal.h> + + + int sd_journal_get_fd + sd_journal* j + + + + int sd_journal_process + sd_journal* j + + + + int sd_journal_wait + sd_journal* j + uint64_t timeout_usec + + + + + + + Description + + sd_journal_get_fd() returns + a file descriptor that may be asynchronously polled in + an external event loop and is signalled readable as + soon as the journal changes, for example because new + entries were added. The file descriptor is suitable + for usage in + poll2 + where it will yield POLLIN on all changes. The call + takes one argument: the journal context object. + + After each POLLIN wake-up + sd_journal_process() needs to be + called to process events and reset the readable state + of the file descriptor. This call will also indicate + what kind of change has been detected (see below; note + that spurious wake-ups are possible). + + A synchronous alternative for using + sd_journal_get_fd() and + sd_journal_process() is + sd_journal_wait(). It will + synchronously wait until the journal gets changed up + to a certain time-out as specified in its second + argument. Pass (uint64_t) -1 to + wait indefinitely. Internally this call simply + combines sd_journal_get_fd(), + poll() and + sd_journal_process() into + one. + + + + + Return Value + + sd_journal_get_fd() returns a valid file descriptor on success or a negative errno-style error + code. + + sd_journal_process() and + sd_journal_wait() return one of + SD_JOURNAL_NOP, + SD_JOURNAL_APPEND or + SD_JOURNAL_INVALIDATE on success or + a negative errno-style error code. If + SD_JOURNAL_NOP is returned the + journal didn't change since the last invocation. If + SD_JOURNAL_APPEND is returned new + entries have been appended to the end of the + journal. If SD_JOURNAL_INVALIDATE + journal files were added or removed (possibly due to + rotation). In the latter event live-view UIs should + probably refresh their entire display while in the + case of SD_JOURNAL_APPEND it is + sufficient to simply continue reading at the previous + end of the journal. + + + + Notes + + The sd_journal_get_fd(), + sd_journal_process() and + sd_journal_wait() interfaces are + available as shared library, which can be compiled and + linked to with the + libsystemd-journal + pkg-config1 + file. + + + + See Also + + + systemd1, + sd-journal3, + sd_journal_open3, + sd_journal_next3 + + + + -- cgit v1.2.3-54-g00ecf