summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/journal/journalctl.c1
-rw-r--r--src/journal/libsystemd-journal.sym5
-rw-r--r--src/journal/sd-journal.c13
-rw-r--r--src/systemd/sd-journal.h1
4 files changed, 19 insertions, 1 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 1f26787cf7..86895b8f5b 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -27,7 +27,6 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
-#include <sys/poll.h>
#include <time.h>
#include <getopt.h>
#include <signal.h>
diff --git a/src/journal/libsystemd-journal.sym b/src/journal/libsystemd-journal.sym
index fbe41501f0..e241318cb0 100644
--- a/src/journal/libsystemd-journal.sym
+++ b/src/journal/libsystemd-journal.sym
@@ -93,3 +93,8 @@ LIBSYSTEMD_JOURNAL_198 {
global:
sd_journal_reliable_fd;
} LIBSYSTEMD_JOURNAL_196;
+
+LIBSYSTEMD_JOURNAL_201 {
+global:
+ sd_journal_get_events;
+} LIBSYSTEMD_JOURNAL_198;
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index bb99671934..3eba4cd0d1 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -1981,6 +1981,19 @@ _public_ int sd_journal_get_fd(sd_journal *j) {
return j->inotify_fd;
}
+_public_ int sd_journal_get_events(sd_journal *j) {
+ int fd;
+
+ if (!j)
+ return -EINVAL;
+
+ fd = sd_journal_get_fd(j);
+ if (fd < 0)
+ return fd;
+
+ return POLLIN;
+}
+
static void process_inotify_event(sd_journal *j, struct inotify_event *e) {
Directory *d;
int r;
diff --git a/src/systemd/sd-journal.h b/src/systemd/sd-journal.h
index 2e8d2d882f..aa7693af70 100644
--- a/src/systemd/sd-journal.h
+++ b/src/systemd/sd-journal.h
@@ -127,6 +127,7 @@ int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_t *l);
void sd_journal_restart_unique(sd_journal *j);
int sd_journal_get_fd(sd_journal *j);
+int sd_journal_get_events(sd_journal *j);
int sd_journal_reliable_fd(sd_journal *j);
int sd_journal_process(sd_journal *j);
int sd_journal_wait(sd_journal *j, uint64_t timeout_usec);