mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 22:50:29 +00:00
journal: add sd_journal_get_catalog_for_message_id() as API to get catalog entry for any message ID without requiring an open journal file
This commit is contained in:
@@ -85,4 +85,5 @@ LIBSYSTEMD_JOURNAL_196 {
|
||||
global:
|
||||
sd_journal_fd_reliable;
|
||||
sd_journal_get_catalog;
|
||||
sd_journal_get_catalog_for_message_id;
|
||||
} LIBSYSTEMD_JOURNAL_195;
|
||||
|
||||
@@ -2449,3 +2449,10 @@ _public_ int sd_journal_get_catalog(sd_journal *j, char **ret) {
|
||||
*ret = t;
|
||||
return 0;
|
||||
}
|
||||
|
||||
_public_ int sd_journal_get_catalog_for_message_id(sd_id128_t id, char **ret) {
|
||||
if (!ret)
|
||||
return -EINVAL;
|
||||
|
||||
return catalog_get(id, ret);
|
||||
}
|
||||
|
||||
@@ -129,6 +129,7 @@ int sd_journal_process(sd_journal *j);
|
||||
int sd_journal_wait(sd_journal *j, uint64_t timeout_usec);
|
||||
|
||||
int sd_journal_get_catalog(sd_journal *j, char **text);
|
||||
int sd_journal_get_catalog_for_message_id(sd_id128_t id, char **ret);
|
||||
|
||||
#define SD_JOURNAL_FOREACH(j) \
|
||||
if (sd_journal_seek_head(j) >= 0) \
|
||||
|
||||
Reference in New Issue
Block a user