Include a fake syslog that does only printf; saves 4K.

This commit is contained in:
christos 2004-06-06 07:03:53 +00:00
parent 95a737969b
commit 0f6740656b
3 changed files with 49 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.16 2004/04/25 06:45:02 christos Exp $
# $NetBSD: Makefile,v 1.17 2004/06/06 07:03:53 christos Exp $
#
# Stubs to kill off some things from libc:
# This save space on a boot system.
@ -11,7 +11,7 @@ CPPFLAGS+= -DSMALL
LIB= hack
SRCS= getcap.c getgrent.c getnet.c getnetgr.c getpwent.c \
localeconv.c perror.c setlocale.c \
strerror.c strsignal.c utmp.c yplib.c
strerror.c strsignal.c syslog.c utmp.c yplib.c
WARNS= 1
NOLINKLIB= # defined

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.17 2004/04/25 06:45:02 christos Exp $
# $NetBSD: Makefile.inc,v 1.18 2004/06/06 07:03:53 christos Exp $
#
# Include this fragment to build libhack.o
# It is .o and not .a to make sure these are the
@ -19,7 +19,7 @@
CPPFLAGS+= -DSMALL
HACKOBJS+= getcap.o getgrent.o getnet.o getnetgr.o getpwent.o \
localeconv.o perror.o setlocale.o \
strerror.o strsignal.o utmp.o yplib.o
strerror.o strsignal.o syslog.o utmp.o yplib.o
libhack.o: ${HACKOBJS}
${LD} -r -o $@ ${HACKOBJS}
@ -38,5 +38,6 @@ perror.o: ${HACKSRC}/perror.c
setlocale.o: ${HACKSRC}/setlocale.c
strerror.o: ${HACKSRC}/strerror.c
strsignal.o: ${HACKSRC}/strsignal.c
syslog.o: ${HACKSRC}/syslog.c
utmp.o: ${HACKSRC}/utmp.c
yplib.o: ${HACKSRC}/yplib.c

View File

@ -0,0 +1,44 @@
#include <sys/types.h>
#include <sys/syslog.h>
#include <stdio.h>
#include <stdarg.h>
void
openlog(const char *path, int opt, int fac)
{
}
void
closelog(void)
{
}
void
syslog(int fac, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
(void)vfprintf(stderr, fmt, ap);
va_end(ap);
}
void
vsyslog(int fac, const char *fmt, va_list ap)
{
(void)vfprintf(stderr, fmt, ap);
}
void
_syslog(int fac, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
(void)vfprintf(stderr, fmt, ap);
va_end(ap);
}
void
_vsyslog(int fac, const char *fmt, va_list ap)
{
(void)vfprintf(stderr, fmt, ap);
}