Last active
August 29, 2015 14:07
-
-
Save daurnimator/091f687b58d2804a9c39 to your computer and use it in GitHub Desktop.
Demostration of seek_tail issue.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CUTOFF = 1413177397982789 | |
TAIL = 0 | |
NEXT = 1 | |
FOUND from 1400437372012374 | |
NEXT = 1 | |
FOUND from 1400438753925868 | |
NEXT = 1 | |
FOUND from 1400438753926192 | |
NEXT = 1 | |
FOUND from 1400438753926257 | |
NEXT = 1 | |
FOUND from 1400438753926289 | |
NEXT = 1 | |
FOUND from 1400438753926309 | |
NEXT = 1 | |
FOUND from 1400438753926330 | |
NEXT = 1 | |
FOUND from 1400438753926353 | |
NEXT = 1 | |
FOUND from 1400438753926373 | |
NEXT = 1 | |
FOUND from 1400438753926395 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <assert.h> | |
#include "systemd/sd-journal.h" | |
int main() { | |
sd_journal* j; | |
assert(sd_journal_open(&j, 0)==0); | |
uint64_t from, to; | |
assert(sd_journal_get_cutoff_realtime_usec(j, &from, &to)==1); | |
printf("CUTOFF = %llu\n", to); | |
printf("TAIL = %d\n", sd_journal_seek_tail(j)); | |
for (int i=0; i<10; i++) { | |
printf("NEXT = %lld\n", sd_journal_next(j)); | |
assert(sd_journal_get_realtime_usec(j, &from)==0); | |
printf("FOUND from %llu\n", from); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment