Skip to content

Instantly share code, notes, and snippets.

@thwarted
Created December 17, 2012 08:53
Show Gist options
  • Select an option

  • Save thwarted/4316789 to your computer and use it in GitHub Desktop.

Select an option

Save thwarted/4316789 to your computer and use it in GitHub Desktop.
lame attempt at redirecting syslog to stderr with LD_PRELOAD
#include <stdlib.h>
#include <stdarg.h>
void openlog(const char *ident, int option, int facility) {
return;
}
void syslog(int priority, const char *format, ...) {
va_list va;
va_start(va, format);
vfprintf(stderr, format, va);
va_end(va);
}
void closelog(void) {
return;
}
/* gcc -fPIC -shared -Wl,-soname,libsyslogtostderr.so.1 -ldl -o libsyslogtostderr.so.1.0 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment