From af05ec876fdb678d90beabf10a637b7d1f046314 Mon Sep 17 00:00:00 2001 From: Joey Schulze Date: Sun, 15 Jun 1997 17:14:04 +0000 Subject: [PATCH] Some more glibc patches made by Michael Alan Dorman . --- klogd.c | 10 +++++++++- ksym_mod.c | 12 +++++++++++- syslogd.c | 13 +++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/klogd.c b/klogd.c index 2f062e9..65a29eb 100644 --- a/klogd.c +++ b/klogd.c @@ -167,6 +167,9 @@ * an unknown amount and overrun a buffer. * I turned these routines into a little parsing state machine that * should not have these problems. + * + * Sun Jun 15 16:23:29 MET DST 1997: Michael Alan Dorman + * Some more glibc patches made by . */ @@ -176,7 +179,9 @@ #include #include #include +#if !defined(__GLIBC__) #include +#endif /* __GLIBC__ */ #include #include #include @@ -187,9 +192,12 @@ #define __LIBRARY__ #include -#ifndef __alpha__ +#if !defined(__GLIBC__) # define __NR_ksyslog __NR_syslog _syscall3(int,ksyslog,int, type, char *, buf, int, len); +#else +#include +#define ksyslog klogctl #endif #define LOG_BUFFER_SIZE 4096 diff --git a/ksym_mod.c b/ksym_mod.c index f93d853..b77543e 100644 --- a/ksym_mod.c +++ b/ksym_mod.c @@ -46,6 +46,9 @@ * * An informative message is printed indicating the number of kernel * modules and the number of symbols loaded from these modules. + * + * Sun Jun 15 16:23:29 MET DST 1997: Michael Alan Dorman + * Some more glibc patches made by . */ @@ -57,8 +60,12 @@ #include #include #include +#if !defined(__GLIBC__) #include #include +#else /* __GLIBC__ */ +#include +#endif /* __GLIBC__ */ #include #include @@ -66,6 +73,7 @@ #include "ksyms.h" +#if !defined(__GLIBC__) /* * The following bit uses some kernel/library magic to product what * looks like a function call to user level code. This function is @@ -78,7 +86,9 @@ _syscall1(int, getsyms, struct kernel_sym *, syms); #undef __LIBRARY__ extern int getsyms(struct kernel_sym *); - +#else /* __GLIBC__ */ +#define getsyms get_kernel_syms +#endif /* __GLIBC__ */ /* Variables static to this module. */ struct sym_table diff --git a/syslogd.c b/syslogd.c index 0db907b..346b16d 100644 --- a/syslogd.c +++ b/syslogd.c @@ -313,6 +313,9 @@ static char sccsid[] = "@(#)syslogd.c 5.27 (Berkeley) 10/10/88"; * Tue Jun 10 12:51:41 MET DST 1997: Martin Schulze * Removed sleep(10) from parent process. This has caused a slow * startup in former times - and I don't see any reason for this. + * + * Sun Jun 15 16:23:29 MET DST 1997: Michael Alan Dorman + * Some more glibc patches made by . */ @@ -594,7 +597,9 @@ int NoHops = 1; /* Can we bounce syslog messages through an intermediate host. */ extern int errno, sys_nerr; +#if !defined(__GLIBC__) extern char *sys_errlist[]; +#endif /* __GLIBC__ */ extern char *ctime(), *index(); /* Function prototypes. */ @@ -618,6 +623,9 @@ void die(int sig); void init(); void cfline(char *line, register struct filed *f); int decode(char *name, struct code *codetab); +#if defined(__GLIBC__) +#define dprintf mydprintf +#endif /* __GLIBC__ */ static void dprintf(char *, ...); static void allocate_log(void); void sighup_handler(); @@ -629,7 +637,12 @@ int main(argc, argv) { register int i; register char *p; +#if !defined(__GLIBC__) int len, num_fds; +#else /* __GLIBC__ */ + size_t len; + int num_fds; +#endif /* __GLIBC__ */ fd_set unixm, readfds; int fd;