configure.ac: readd missing test on "modern" utmp database

There was an incompatible change in struct utmp and the test to validate
if we are using the old or the new format has been removed in the
past decade somehow.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
lib/compat: move getutent/endutent implementation from utils.c

An ancient version of the compat library was present (and now rediscovered)
in utils.c, move it to its new home.

The inet_aton() implementation is coming in a separate patch.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
afuser: factor utmp specific mess from the main body of the queue function()

Instead of doing a lot of ifdef trickery in the queue() function, use
separate static wrappers for that.

Also adds a locking around the use of the inherently non-thread-safe
utmp interface.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
afuser: remove alarm workaround

The Linux kernel used to have a bug that caused the afuser driver
to block even if O_NONBLOCK is set in the open flags. It was fixed
a long time ago, and alarm() is incompatible with multithreaded programs,
thus get rid off the alarm() call to detect blocked ttys.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
compat: add strtok_r implementation for platforms that lack that
compat: add inet_aton() for compatibility with platforms that lack one

Signed-off-by: Viktor Juhasz <jviktor@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
syslog-ng.h: added windows.h inclusion

This patch adds the inclusion of the Win32 windows.h header into syslog-ng.h
through a compat/win32.h wrapper. It uses the WIN32_LEAN_AND_MEAN
macro to minimize the global namespace pollution.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
compat: added a number of time related function implementations for platforms that lack them

These functions are implemented:
  - clock_gettime() - based on gettimeofday, potentially platform independent
  - localtime_r()   - based on localtime(), potentially platform independent
  - strptime()      - implementation from NetBSD, potentially platform independent
  - nanosleep()     - Win32 specific
  - sleep()         - Win32 specific

Signed-off-by: Viktor Juhasz <jviktor@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
compat: add win32 specific fsync implementation
compat: add win32 mmap() implementation
compat: add win32 specific getpid() implementation
compat: add win32 support to socket

This patch adds Win32 support to the socket compat module.

Signed-off-by: Viktor Juhasz <jviktor@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
compat: add win32 specific iov implementation
compat: add win32 support in string.h
compat: add win32 iv_fd implementation
compat: add win32 implementation for syslog() constants
gsocket: add win32 support

This patch add a g_socket_global_init()/deinit() functions that allows
explicit initialization of socket related code. It is used to
initialize winsock2 on Windows.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
get_processor_count: add win32 port
WIP: eventlog-tags
WIP: g_socket_get_error() on win32