syslog-ng source
misc.c File Reference
#include "compat/time.h"
#include "timeutils/misc.h"
#include "timeutils/cache.h"
#include "messages.h"
#include <errno.h>
#include <string.h>
Include dependency graph for misc.c:

Functions

gboolean check_nanosleep (void)
 
void timespec_add_msec (struct timespec *ts, glong msec)
 
void timespec_add_usec (struct timespec *ts, gint64 usec)
 
glong timespec_diff_msec (const struct timespec *t1, const struct timespec *t2)
 
gint64 timespec_diff_usec (const struct timespec *t1, const struct timespec *t2)
 
gint64 timespec_diff_nsec (struct timespec *t1, struct timespec *t2)
 

Function Documentation

◆ check_nanosleep()

gboolean check_nanosleep ( void  )

check_nanosleep:

Check if nanosleep() is accurate enough for sub-millisecond sleeping. If it is not good enough, we're skipping the minor sleeps in LogReader to balance the cost of returning to the main loop (e.g. we're always going to return to the main loop, instead of trying to wait for the writer).

◆ timespec_add_msec()

void timespec_add_msec ( struct timespec *  ts,
glong  msec 
)

◆ timespec_add_usec()

void timespec_add_usec ( struct timespec *  ts,
gint64  usec 
)

◆ timespec_diff_msec()

glong timespec_diff_msec ( const struct timespec *  t1,
const struct timespec *  t2 
)

◆ timespec_diff_nsec()

gint64 timespec_diff_nsec ( struct timespec *  t1,
struct timespec *  t2 
)

◆ timespec_diff_usec()

gint64 timespec_diff_usec ( const struct timespec *  t1,
const struct timespec *  t2 
)