X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=man%2Fsd_journal_next.xml;h=1409b0dba30c695541c07c33db6ec1285b2bf9ca;hp=f55ee157444f5d954f11f4de84fe4a879a8c1223;hb=c305c32580a1d7689a401e8cf673ec7936c12bbe;hpb=67c3cf4f9ea35c1f789526b24a4d052d071902c0 diff --git a/man/sd_journal_next.xml b/man/sd_journal_next.xml index f55ee1574..1409b0dba 100644 --- a/man/sd_journal_next.xml +++ b/man/sd_journal_next.xml @@ -47,6 +47,8 @@ sd_journal_previous sd_journal_next_skip sd_journal_previous_skip + SD_JOURNAL_FOREACH + SD_JOURNAL_FOREACH_BACKWARDS Advance or set back the read pointer in the journal @@ -76,6 +78,15 @@ uint64_t skip + + SD_JOURNAL_FOREACH + sd_journal* j + + + + SD_JOURNAL_FOREACH_BACKWARDS + sd_journal* j + @@ -91,7 +102,7 @@ functions such as sd_journal_get_data3. - Similar, sd_journal_previous() sets + Similarly, sd_journal_previous() sets the read pointer back one entry. sd_journal_next_skip() and @@ -105,13 +116,20 @@ that the entry then pointing to is later in time than then previous one, or has the same timestamp. + Note that + sd_journal_get_data3 + and related calls will fail unless + sd_journal_next() has been + invoked at least once in order to position the read + pointer on a journal entry. + Note that the SD_JOURNAL_FOREACH() macro may be used as a wrapper around sd_journal_seek_head3 and sd_journal_next() in order to - make iteratring through the journal easier. See below - for an example. Similar, + make iterating through the journal easier. See below + for an example. Similarly, SD_JOURNAL_FOREACH_BACKWARDS() may be used for iterating the journal in reverse order. @@ -122,8 +140,8 @@ The four calls return the number of entries advanced/set back on success or a negative errno-style - error code. When the end (resp. beginning) of the journal - is reached a number smaller than requested is + error code. When the end or beginning of the journal + is reached, a number smaller than requested is returned. More specifically, if sd_journal_next() or sd_journal_previous() reach the @@ -138,10 +156,9 @@ The sd_journal_next(), sd_journal_previous(), sd_journal_next_skip() and sd_journal_previous_skip() interfaces are - available as shared library, which can be compiled and + available as a shared library, which can be compiled and linked to with the - libsystemd-journal - pkg-config1 + libsystemd-journal pkg-config1 file. @@ -187,7 +204,9 @@ int main(int argc, char *argv[]) { systemd1, sd-journal3, sd_journal_open3, - sd_journal_get_data3 + sd_journal_get_data3, + sd_journal_get_realtime_usec3, + sd_journal_get_cursor3