mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-15 10:30:40 +01:00
... and failures of getaddrinfo() when obtaining hostname. This requires a number of testing LD_PRELOD libraries, which just simulate system error. The actual test is rather small. see also https://github.com/rsyslog/rsyslog/issues/1573
29 lines
757 B
C
29 lines
757 B
C
// we need this for dlsym(): #include <dlfcn.h>
|
|
#include "config.h"
|
|
#include <stdio.h>
|
|
#include <errno.h>
|
|
#include <sys/types.h>
|
|
#include <sys/socket.h>
|
|
#include <netdb.h>
|
|
|
|
int getaddrinfo(const char *node __attribute__((unused)),
|
|
const char *service __attribute__((unused)),
|
|
const struct addrinfo *hints __attribute__((unused)),
|
|
struct addrinfo **res __attribute__((unused)))
|
|
{
|
|
return EAI_MEMORY;
|
|
}
|
|
|
|
static void __attribute__((constructor))
|
|
my_init(void)
|
|
{
|
|
/* we currently do not need this entry point, but keep it as
|
|
* a "template". It can be used, e.g. to emit some diagnostic
|
|
* information:
|
|
printf("loaded\n");
|
|
* or - more importantly - obtain a pointer to the overriden
|
|
* API:
|
|
orig_etry = dlsym(RTLD_NEXT, "original_entry_point");
|
|
*/
|
|
}
|