summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-02-29 13:29:24 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-02-29 13:29:24 +0000
commit3c2bc3a8dd87443da5825eceb2fea5f6d9aec10c (patch)
treea73d653ffd7f6d1e5013ae53fe4aad347ed6af36 /sys
parentae8f5c38ed6646b28514a4b1eccf7b8a0b3dafcf (diff)
From NetBSD: Merge with NetBSD 960217
Diffstat (limited to 'sys')
-rw-r--r--sys/lib/libkern/Makefile10
-rw-r--r--sys/lib/libkern/Makefile.inc33
-rw-r--r--sys/lib/libkern/arch/m68k/Makefile.inc6
-rw-r--r--sys/lib/libkern/libkern.h8
-rw-r--r--sys/lib/libkern/strncasecmp.c66
-rw-r--r--sys/lib/libsa/exit.c5
-rw-r--r--sys/lib/libsa/printf.c9
7 files changed, 108 insertions, 29 deletions
diff --git a/sys/lib/libkern/Makefile b/sys/lib/libkern/Makefile
index af57b69848e..7cc5389b7d3 100644
--- a/sys/lib/libkern/Makefile
+++ b/sys/lib/libkern/Makefile
@@ -1,13 +1,13 @@
-# $NetBSD: Makefile,v 1.24 1995/10/20 01:10:06 cgd Exp $
+# $OpenBSD: Makefile,v 1.3 1996/02/29 13:27:47 niklas Exp $
+# $NetBSD: Makefile,v 1.25 1996/02/02 20:34:38 mycroft Exp $
LIB= kern
NOPIC=
-DIR=${KERNREL}${KERNDIR}
+DIR= ${KERNREL}${KERNDIR}
-CC= ${KERNCC}
-CFLAGS= -I${DIR}/arch/${MACHINE_ARCH} \
- ${KERNCFLAGS:S/-D_KERNEL//:S@-I.@-I${KERNREL}.@g}
+CPPFLAGS= -I${DIR}/arch/${MACHINE_ARCH} \
+ ${KERNCPPFLAGS:S/-D_KERNEL//:S@-I.@-I${KERNREL}.@g}
.if exists (${DIR}/arch/${MACHINE_ARCH}/Makefile.inc)
.PATH: ${DIR}/arch/${MACHINE_ARCH}
diff --git a/sys/lib/libkern/Makefile.inc b/sys/lib/libkern/Makefile.inc
index 1c0a003a913..1314ceb54fa 100644
--- a/sys/lib/libkern/Makefile.inc
+++ b/sys/lib/libkern/Makefile.inc
@@ -1,4 +1,5 @@
-# $NetBSD: Makefile.inc,v 1.12 1995/10/07 09:56:55 mycroft Exp $
+# $OpenBSD: Makefile.inc,v 1.2 1996/02/29 13:27:48 niklas Exp $
+# $NetBSD: Makefile.inc,v 1.13 1996/02/02 20:34:41 mycroft Exp $
#
# NOTE: $S must correspond to the top of the 'sys' tree
@@ -9,29 +10,27 @@ KERNREL?= ../../
KERNLIB?= ${KERNDST}/libkern.o
KERNLIB_PROF= ${KERNDST}/libkern.po
+KERNMAKE= \
+ cd ${KERNDST} && ${MAKE} -f ${KERNREL}${KERNDIR}/Makefile \
+ CC="${CC}" CFLAGS="${CFLAGS}" \
+ AS="${AS}" AFLAGS="${AFLAGS}" \
+ LD="${LD}" \
+ MACHINE="${MACHINE}" MACHINE_ARCH="${MACHINE_ARCH}" \
+ KERNCPPFLAGS="${CPPFLAGS}" \
+ KERNREL="${KERNREL}" \
+ KERNDIR="${KERNDIR}"
+
${KERNLIB}: .NOTMAIN __always_make_kernlib
@echo making sure the kern library is up to date...
- @(cd ${KERNDST} && ${MAKE} -f ${KERNREL}${KERNDIR}/Makefile \
- KERNCC="${CC}" \
- KERNCFLAGS="${CFLAGS}" \
- KERNREL="${KERNREL}" \
- KERNDIR="${KERNDIR}" libkern.o)
+ @${KERNMAKE} libkern.o
${KERNLIB_PROF}: .NOTMAIN __always_make_kernlib
@echo making sure the profiled kern library is up to date...
- @(cd ${KERNDST} && ${MAKE} -f ${KERNREL}${KERNDIR}/Makefile \
- KERNCC="${CC}" \
- KERNCFLAGS="${CFLAGS}" \
- KERNREL="${KERNREL}" \
- KERNDIR="${KERNDIR}" libkern.po)
+ @${KERNMAKE} libkern.po
clean:: .NOTMAIN __always_make_kernlib
@echo cleaning the kern library objects
- @(cd ${KERNDST} && ${MAKE} -f ${KERNREL}${KERNDIR}/Makefile \
- KERNCC="${CC}" \
- KERNCFLAGS="${CFLAGS}" \
- KERNREL="${KERNREL}" \
- KERNDIR="${KERNDIR}" clean)
+ @${KERNMAKE} clean
__always_make_kernlib: .NOTMAIN
- @([ -d ${KERNDST} ] || mkdir -p ${KERNDST})
+ @mkdir -p ${KERNDST}
diff --git a/sys/lib/libkern/arch/m68k/Makefile.inc b/sys/lib/libkern/arch/m68k/Makefile.inc
index 1f8844f6f87..4a82786b2e9 100644
--- a/sys/lib/libkern/arch/m68k/Makefile.inc
+++ b/sys/lib/libkern/arch/m68k/Makefile.inc
@@ -1,5 +1,7 @@
-# $NetBSD: Makefile.inc,v 1.5 1994/10/26 06:39:22 cgd Exp $
+# $OpenBSD: Makefile.inc,v 1.2 1996/02/29 13:28:27 niklas Exp $
+# $NetBSD: Makefile.inc,v 1.6 1996/02/06 21:22:06 christos Exp $
SRCS+= __main.c imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c \
bcmp.S bzero.S ffs.S strcat.c strcmp.S strcpy.S strlen.S strncmp.S \
- strncpy.S htonl.S htons.S ntohl.S ntohs.S scanc.S skpc.S locc.S
+ strncpy.S htonl.S htons.S ntohl.S ntohs.S scanc.S skpc.S locc.S \
+ strncasecmp.c
diff --git a/sys/lib/libkern/libkern.h b/sys/lib/libkern/libkern.h
index 01169467c7e..e292a3ca8b1 100644
--- a/sys/lib/libkern/libkern.h
+++ b/sys/lib/libkern/libkern.h
@@ -1,4 +1,5 @@
-/* $NetBSD: libkern.h,v 1.5 1995/09/23 20:35:47 leo Exp $ */
+/* $OpenBSD: libkern.h,v 1.2 1996/02/29 13:27:49 niklas Exp $ */
+/* $NetBSD: libkern.h,v 1.6 1996/02/13 23:48:26 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -111,7 +112,10 @@ u_long random __P((void));
char *rindex __P((const char *, int));
int scanc __P((u_int, u_char *, u_char *, int));
int skpc __P((int, int, char *));
+size_t strlen __P((const char *));
char *strcat __P((char *, const char *));
char *strcpy __P((char *, const char *));
-size_t strlen __P((const char *));
char *strncpy __P((char *, const char *, size_t));
+int strcmp __P((const char *, const char *));
+int strncmp __P((const char *, const char *, size_t));
+int strncasecmp __P((const char *, const char *, size_t));
diff --git a/sys/lib/libkern/strncasecmp.c b/sys/lib/libkern/strncasecmp.c
new file mode 100644
index 00000000000..a0c6633adeb
--- /dev/null
+++ b/sys/lib/libkern/strncasecmp.c
@@ -0,0 +1,66 @@
+/* $OpenBSD: strncasecmp.c,v 1.1 1996/02/29 13:27:50 niklas Exp $ */
+
+/*
+ * Copyright (c) 1994 Christian E. Hopps
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Christian E. Hopps.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#if defined(LIBC_SCCS) && !defined(lint)
+static char *rcsid = "$Id: strncasecmp.c,v 1.1 1996/02/29 13:27:50 niklas Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <string.h>
+
+int
+strncasecmp(s1, s2, n)
+ const char *s1;
+ const char *s2;
+ size_t n;
+{
+ if (n == 0)
+ return 0;
+
+ do {
+ unsigned char c1 = (unsigned char) *s1++;
+ unsigned char c2 = (unsigned char) *s2++;
+
+ if (c1 != c2) {
+ if (c1 >= 'A' && c1 <= 'Z' &&
+ c2 >= 'a' && c2 <= 'z')
+ c1 += 'a' - 'A';
+ else if (c1 >= 'a' && c1 <= 'z' &&
+ c2 >= 'A' && c2 <= 'Z')
+ c2 += 'a' - 'A';
+ if (c1 != c2)
+ return c1 - c2;
+ }
+ if (c1 == 0)
+ break;
+ } while (--n != 0);
+
+ return 0;
+}
diff --git a/sys/lib/libsa/exit.c b/sys/lib/libsa/exit.c
index 0108e376835..1cb2e7a0d2e 100644
--- a/sys/lib/libsa/exit.c
+++ b/sys/lib/libsa/exit.c
@@ -1,4 +1,5 @@
-/* $NetBSD: exit.c,v 1.7 1995/09/18 21:19:25 pk Exp $ */
+/* $OpenBSD: exit.c,v 1.2 1996/02/29 13:29:22 niklas Exp $ */
+/* $NetBSD: exit.c,v 1.8 1996/02/09 16:10:59 gwr Exp $ */
/*-
* Copyright (c) 1993 John Brezak
@@ -57,7 +58,7 @@ panic(fmt /*, va_alist */)
#else
va_start(ap);
#endif
- printf(fmt, ap);
+ vprintf(fmt, ap);
printf("\n");
va_end(ap);
_rtt();
diff --git a/sys/lib/libsa/printf.c b/sys/lib/libsa/printf.c
index a0a6dc86442..3f038648131 100644
--- a/sys/lib/libsa/printf.c
+++ b/sys/lib/libsa/printf.c
@@ -1,4 +1,5 @@
-/* $NetBSD: printf.c,v 1.6 1995/09/03 20:51:21 pk Exp $ */
+/* $OpenBSD: printf.c,v 1.2 1996/02/29 13:29:23 niklas Exp $ */
+/* $NetBSD: printf.c,v 1.7 1996/02/08 20:19:36 gwr Exp $ */
/*-
* Copyright (c) 1993
@@ -122,6 +123,12 @@ printf(fmt, va_alist)
}
void
+vprintf(const char *fmt, va_list ap)
+{
+ kprintf(putchar, fmt, ap);
+}
+
+void
kprintf(put, fmt, ap)
void (*put)__P((int));
const char *fmt;