summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-03-25 23:31:49 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-03-25 23:31:49 +0000
commit11fe3ba74681b3b35fe669fe360a7772cad3754a (patch)
treef959b101ec70b7e9f47fb43ad87926b59de5fb6a /lib
parent57fc76ed93195dead94120a74b200456106bc834 (diff)
Add support for building lint(1) library
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/Makefile2
-rw-r--r--lib/libc/arch/alpha/protolib.h46
-rw-r--r--lib/libc/arch/alpha/string/Makefile.inc1
-rw-r--r--lib/libc/arch/i386/net/Makefile.inc1
-rw-r--r--lib/libc/arch/i386/protolib.h57
-rw-r--r--lib/libc/arch/i386/string/Makefile.inc2
-rw-r--r--lib/libc/arch/m68k/net/Makefile.inc1
-rw-r--r--lib/libc/arch/m68k/protolib.h57
-rw-r--r--lib/libc/arch/m68k/string/Makefile.inc2
-rw-r--r--lib/libc/arch/mips/net/Makefile.inc1
-rw-r--r--lib/libc/arch/mips/protolib.h47
-rw-r--r--lib/libc/arch/mips/string/Makefile.inc1
-rw-r--r--lib/libc/arch/ns32k/net/Makefile.inc1
-rw-r--r--lib/libc/arch/ns32k/protolib.h51
-rw-r--r--lib/libc/arch/ns32k/string/Makefile.inc1
-rw-r--r--lib/libc/arch/sparc/net/Makefile.inc1
-rw-r--r--lib/libc/arch/sparc/protolib.h48
-rw-r--r--lib/libc/arch/sparc/string/Makefile.inc1
-rw-r--r--lib/libc/arch/vax/net/Makefile.inc1
-rw-r--r--lib/libc/arch/vax/protolib.h50
-rw-r--r--lib/libc/stdlib/Makefile.inc6
-rw-r--r--lib/libc/string/Makefile.inc22
-rw-r--r--lib/libc/sys/Makefile.inc5
-rw-r--r--lib/libc/sys/protolib.c256
24 files changed, 658 insertions, 3 deletions
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index 3c57c4b127b..e1aad2a8ce5 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -16,6 +16,8 @@
LIB=c
CFLAGS+=-DNLS -DYP -DLIBC_SCCS -DSYSLIBC_SCCS -I${.CURDIR}/include
+LINTFLAGS=-z
+LLIBS=
AINC= -I${.CURDIR}/arch/${MACHINE_ARCH}
.if defined(DESTDIR)
AINC+= -nostdinc -idirafter ${DESTDIR}/usr/include
diff --git a/lib/libc/arch/alpha/protolib.h b/lib/libc/arch/alpha/protolib.h
new file mode 100644
index 00000000000..d47867e4c9f
--- /dev/null
+++ b/lib/libc/arch/alpha/protolib.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 1995 Jochen Pohl
+ * 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 Jochen Pohl for
+ * The NetBSD project.
+ * 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.
+ *
+ * $OpenBSD: protolib.h,v 1.1 1996/03/25 23:31:17 tholo Exp $
+ */
+
+#include <math.h>
+#include <setjmp.h>
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+double fabs(double);
+void longjmp(jmp_buf, int);
+void _longjmp(jmp_buf, int);
+int setjmp(jmp_buf);
+int _setjmp(jmp_buf);
+void siglongjmp(sigjmp_buf, int);
+int sigsetjmp(sigjmp_buf, int);
diff --git a/lib/libc/arch/alpha/string/Makefile.inc b/lib/libc/arch/alpha/string/Makefile.inc
index 9fd15adc920..5482c299975 100644
--- a/lib/libc/arch/alpha/string/Makefile.inc
+++ b/lib/libc/arch/alpha/string/Makefile.inc
@@ -5,3 +5,4 @@ SRCS+= bcmp.c bcopy.S bzero.S ffs.c index.c memchr.c memcmp.c memset.c \
strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \
strspn.c strstr.c swab.c
SRCS+= memcpy.S memmove.S
+LSRCS+= bcopy.c bzero.c
diff --git a/lib/libc/arch/i386/net/Makefile.inc b/lib/libc/arch/i386/net/Makefile.inc
index 4624dbf43a6..627806ea8ae 100644
--- a/lib/libc/arch/i386/net/Makefile.inc
+++ b/lib/libc/arch/i386/net/Makefile.inc
@@ -1,3 +1,4 @@
# $NetBSD: Makefile.inc,v 1.1 1995/02/25 14:58:50 cgd Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S
+LSRCS+= htonl.c htons.c ntohl.c ntohs.c
diff --git a/lib/libc/arch/i386/protolib.h b/lib/libc/arch/i386/protolib.h
new file mode 100644
index 00000000000..b76ca38f996
--- /dev/null
+++ b/lib/libc/arch/i386/protolib.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 1995 Jochen Pohl
+ * 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 Jochen Pohl for
+ * The NetBSD project.
+ * 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.
+ *
+ * $OpenBSD: protolib.h,v 1.1 1996/03/25 23:31:19 tholo Exp $
+ */
+
+#include <float.h>
+#include <ieeefp.h>
+#include <math.h>
+#include <setjmp.h>
+#include <stdlib.h>
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+void *alloca(size_t);
+double fabs(double);
+int __flt_rounds(void);
+fp_except fpgetmask(void);
+fp_rnd fpgetround(void);
+fp_except fpgetsticky(void);
+fp_except fpsetmask(fp_except);
+fp_rnd fpsetround(fp_rnd);
+void _longjmp(jmp_buf, int);
+void longjmp(jmp_buf, int);
+double modf(double, double *);
+int _setjmp(jmp_buf);
+int setjmp(jmp_buf);
+void siglongjmp(sigjmp_buf, int);
+int sigsetjmp(sigjmp_buf, int);
diff --git a/lib/libc/arch/i386/string/Makefile.inc b/lib/libc/arch/i386/string/Makefile.inc
index 696a32cc032..dc18bc39143 100644
--- a/lib/libc/arch/i386/string/Makefile.inc
+++ b/lib/libc/arch/i386/string/Makefile.inc
@@ -5,3 +5,5 @@ SRCS+= bcmp.S bcopy.S bzero.S ffs.S index.S memchr.S memcmp.S memset.S \
strncat.c strncmp.S strncpy.c strpbrk.c strsep.c \
strspn.c strstr.c swab.S
SRCS+= memcpy.S memmove.S strchr.S strrchr.S
+LSRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memchr.c memcmp.c memset.c \
+ rindex.c strcat.c strcmp.c strcpy.c strlen.c strncmp.c swab.c
diff --git a/lib/libc/arch/m68k/net/Makefile.inc b/lib/libc/arch/m68k/net/Makefile.inc
index dc2ddf344cc..7cd3b4345ec 100644
--- a/lib/libc/arch/m68k/net/Makefile.inc
+++ b/lib/libc/arch/m68k/net/Makefile.inc
@@ -1,3 +1,4 @@
# $NetBSD: Makefile.inc,v 1.1 1995/02/25 14:58:55 cgd Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S
+LSRCS+= htonl.c htons.c ntohl.c ntohs.c
diff --git a/lib/libc/arch/m68k/protolib.h b/lib/libc/arch/m68k/protolib.h
new file mode 100644
index 00000000000..18305bd8890
--- /dev/null
+++ b/lib/libc/arch/m68k/protolib.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 1995 Jochen Pohl
+ * 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 Jochen Pohl for
+ * The NetBSD project.
+ * 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.
+ *
+ * $OpenBSD: protolib.h,v 1.1 1996/03/25 23:31:24 tholo Exp $
+ */
+
+#include <float.h>
+#include <ieeefp.h>
+#include <math.h>
+#include <setjmp.h>
+#include <stdlib.h>
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+void *alloca(size_t);
+double fabs(double);
+int __flt_rounds(void);
+fp_except fpgetmask(void);
+fp_rnd fpgetround(void);
+fp_except fpgetsticky(void);
+fp_except fpsetmask(fp_except);
+fp_rnd fpsetround(fp_rnd);
+void _longjmp(jmp_buf, int);
+void longjmp(jmp_buf, int);
+double modf(double, double *);
+int _setjmp(jmp_buf);
+int setjmp(jmp_buf);
+void siglongjmp(sigjmp_buf, int);
+int sigsetjmp(sigjmp_buf, int);
diff --git a/lib/libc/arch/m68k/string/Makefile.inc b/lib/libc/arch/m68k/string/Makefile.inc
index e06c0d02828..a4584004295 100644
--- a/lib/libc/arch/m68k/string/Makefile.inc
+++ b/lib/libc/arch/m68k/string/Makefile.inc
@@ -5,3 +5,5 @@ SRCS+= bcmp.S bcopy.S bzero.S ffs.S index.S memchr.c memcmp.S memset.S \
strncat.c strncmp.S strncpy.S strpbrk.c strsep.c \
strspn.c strstr.c swab.S
SRCS+= memcpy.S memmove.S strchr.S strrchr.S
+LSRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memcmp.c memset.c rindex.c \
+ strcmp.c strcpy.c strlen.c strncmp.c strncpy.c swab.c
diff --git a/lib/libc/arch/mips/net/Makefile.inc b/lib/libc/arch/mips/net/Makefile.inc
index ea0902c029c..6ae539be352 100644
--- a/lib/libc/arch/mips/net/Makefile.inc
+++ b/lib/libc/arch/mips/net/Makefile.inc
@@ -1,3 +1,4 @@
# $NetBSD: Makefile.inc,v 1.1 1995/02/25 14:59:01 cgd Exp $
SRCS+= htonl.S htons.S
+LSRCS+= htonl.c htons.c
diff --git a/lib/libc/arch/mips/protolib.h b/lib/libc/arch/mips/protolib.h
new file mode 100644
index 00000000000..d14f39dfca6
--- /dev/null
+++ b/lib/libc/arch/mips/protolib.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 1995 Jochen Pohl
+ * 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 Jochen Pohl for
+ * The NetBSD project.
+ * 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.
+ *
+ * $OpenBSD: protolib.h,v 1.1 1996/03/25 23:31:28 tholo Exp $
+ */
+
+#include <math.h>
+#include <setjmp.h>
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+double fabs(double);
+int isinf(double);
+double ldexp(double, int);
+void longjmp(jmp_buf, int);
+void _longjmp(jmp_buf, int);
+double modf(double, double *);
+int setjmp(jmp_buf);
+int _setjmp(jmp_buf);
diff --git a/lib/libc/arch/mips/string/Makefile.inc b/lib/libc/arch/mips/string/Makefile.inc
index b085ea37000..8e741637bc7 100644
--- a/lib/libc/arch/mips/string/Makefile.inc
+++ b/lib/libc/arch/mips/string/Makefile.inc
@@ -4,3 +4,4 @@ SRCS+= bcmp.S bcopy.S bzero.S ffs.S index.S memchr.c memcmp.c memset.c \
rindex.S strcat.c strcmp.S strcpy.c strcspn.c strlen.S \
strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \
strspn.c strstr.c swab.c
+LSRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c rindex.c strcmp.c strlen.c
diff --git a/lib/libc/arch/ns32k/net/Makefile.inc b/lib/libc/arch/ns32k/net/Makefile.inc
index 2dd5bc77782..fdc6f567436 100644
--- a/lib/libc/arch/ns32k/net/Makefile.inc
+++ b/lib/libc/arch/ns32k/net/Makefile.inc
@@ -1,3 +1,4 @@
# $NetBSD: Makefile.inc,v 1.1 1995/02/25 14:59:07 cgd Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S
+LSRCS+= htonl.c htons.c ntohl.c ntohs.c
diff --git a/lib/libc/arch/ns32k/protolib.h b/lib/libc/arch/ns32k/protolib.h
new file mode 100644
index 00000000000..b0424e71eb4
--- /dev/null
+++ b/lib/libc/arch/ns32k/protolib.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 1995 Jochen Pohl
+ * 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 Jochen Pohl for
+ * The NetBSD project.
+ * 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.
+ *
+ * $OpenBSD: protolib.h,v 1.1 1996/03/25 23:31:32 tholo Exp $
+ */
+
+#include <math.h>
+#include <setjmp.h>
+#include <stdlib.h>
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+void *alloca(size_t);
+double fabs(double);
+double frexp(double, int *);
+double ldexp(double, int);
+void longjmp(jmp_buf, int);
+void _longjmp(jmp_buf, int);
+double modf(double, double *);
+int setjmp(jmp_buf);
+int _setjmp(jmp_buf);
+void siglongjmp(sigjmp_buf, int);
+int sigsetjmp(sigjmp_buf, int);
diff --git a/lib/libc/arch/ns32k/string/Makefile.inc b/lib/libc/arch/ns32k/string/Makefile.inc
index e35f0f72a3a..fd0ad1e560c 100644
--- a/lib/libc/arch/ns32k/string/Makefile.inc
+++ b/lib/libc/arch/ns32k/string/Makefile.inc
@@ -4,4 +4,3 @@ SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memchr.c memcmp.c memset.c \
rindex.c strcat.c strcmp.c strcpy.c strcspn.c strlen.c \
strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \
strspn.c strstr.c swab.c
-#SRCS+= memmove.c strchr.c strrchr.c
diff --git a/lib/libc/arch/sparc/net/Makefile.inc b/lib/libc/arch/sparc/net/Makefile.inc
index 0279aaa3b09..a1feacb37d4 100644
--- a/lib/libc/arch/sparc/net/Makefile.inc
+++ b/lib/libc/arch/sparc/net/Makefile.inc
@@ -1,3 +1,4 @@
# $NetBSD: Makefile.inc,v 1.1 1995/02/25 14:59:11 cgd Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S
+LSRCS+= htonl.c htons.c ntohl.c ntohs.c
diff --git a/lib/libc/arch/sparc/protolib.h b/lib/libc/arch/sparc/protolib.h
new file mode 100644
index 00000000000..62c87e353aa
--- /dev/null
+++ b/lib/libc/arch/sparc/protolib.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 1995 Jochen Pohl
+ * 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 Jochen Pohl for
+ * The NetBSD project.
+ * 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.
+ *
+ * $OpenBSD: protolib.h,v 1.1 1996/03/25 23:31:36 tholo Exp $
+ */
+
+#include <math.h>
+#include <setjmp.h>
+#include <stdlib.h>
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+double fabs(double);
+void longjmp(jmp_buf, int);
+void _longjmp(jmp_buf, int);
+double modf(double, double *);
+int setjmp(jmp_buf);
+int _setjmp(jmp_buf);
+void siglongjmp(sigjmp_buf, int);
+int sigsetjmp(sigjmp_buf, int);
diff --git a/lib/libc/arch/sparc/string/Makefile.inc b/lib/libc/arch/sparc/string/Makefile.inc
index a4f403b1713..47819f34384 100644
--- a/lib/libc/arch/sparc/string/Makefile.inc
+++ b/lib/libc/arch/sparc/string/Makefile.inc
@@ -4,3 +4,4 @@ SRCS+= bcmp.c bcopy.c bzero.S ffs.S index.c memchr.c memcmp.c memset.c \
rindex.c strcat.c strcmp.c strcpy.c strcspn.c strlen.S \
strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \
strspn.c strstr.c swab.c
+LSRCS+= bzero.c ffs.c strlen.c
diff --git a/lib/libc/arch/vax/net/Makefile.inc b/lib/libc/arch/vax/net/Makefile.inc
index 309dbeb3974..2212f87f2e8 100644
--- a/lib/libc/arch/vax/net/Makefile.inc
+++ b/lib/libc/arch/vax/net/Makefile.inc
@@ -1,3 +1,4 @@
# $NetBSD: Makefile.inc,v 1.1 1995/04/17 12:23:49 ragge Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S
+LSRCS+= htonl.c htons.c ntohl.c ntohs.c
diff --git a/lib/libc/arch/vax/protolib.h b/lib/libc/arch/vax/protolib.h
new file mode 100644
index 00000000000..c0fde949493
--- /dev/null
+++ b/lib/libc/arch/vax/protolib.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 1995 Jochen Pohl
+ * 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 Jochen Pohl for
+ * The NetBSD project.
+ * 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.
+ *
+ * $OpenBSD: protolib.h,v 1.1 1996/03/25 23:31:40 tholo Exp $
+ */
+
+#include <math.h>
+#include <setjmp.h>
+#include <stdlib.h>
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+void *alloca(size_t);
+double fabs(double);
+void longjmp(jmp_buf, int);
+void _longjmp(jmp_buf, int);
+double ldexp(double, int);
+double modf(double, double *);
+int setjmp(jmp_buf);
+int _setjmp(jmp_buf);
+void siglongjmp(sigjmp_buf, int);
+int sigsetjmp(sigjmp_buf, int);
diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc
index 6369c58b35b..625f0f9a91b 100644
--- a/lib/libc/stdlib/Makefile.inc
+++ b/lib/libc/stdlib/Makefile.inc
@@ -1,5 +1,5 @@
# from: @(#)Makefile.inc 5.6 (Berkeley) 6/4/91
-# $Id: Makefile.inc,v 1.1 1995/10/18 08:42:16 deraadt Exp $
+# $Id: Makefile.inc,v 1.2 1996/03/25 23:31:43 tholo Exp $
# stdlib sources
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/stdlib ${.CURDIR}/stdlib
@@ -13,12 +13,16 @@ SRCS+= a64l.c abort.c atexit.c atoi.c atof.c atol.c bsearch.c calloc.c \
.if (${MACHINE_ARCH} == "m68k")
SRCS+= abs.S div.c labs.c ldiv.c
+LSRCS+= abs.c
.elif (${MACHINE_ARCH} == "i386")
SRCS+= abs.S div.S labs.S ldiv.S
+LSRCS+= abs.c div.c labs.c ldiv.c
.elif (${MACHINE_ARCH} == "ns32k")
SRCS+= abs.S div.c labs.c ldiv.c
+LSRCS+= abs.c
.elif (${MACHINE_ARCH} == "tahoe")
SRCS+= abs.S div.c labs.c ldiv.c
+LSRCS+= abs.c
.elif (${MACHINE_ARCH} == "vax")
SRCS+= abs.c div.c labs.c ldiv.c
.elif (${MACHINE_ARCH} == "alpha")
diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc
index 549379e7fb0..9b7e25cd951 100644
--- a/lib/libc/string/Makefile.inc
+++ b/lib/libc/string/Makefile.inc
@@ -1,5 +1,5 @@
# from: @(#)Makefile.inc 5.6 (Berkeley) 3/5/91
-# $Id: Makefile.inc,v 1.1 1995/10/18 08:42:20 deraadt Exp $
+# $Id: Makefile.inc,v 1.2 1996/03/25 23:31:46 tholo Exp $
# string sources
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/string ${.CURDIR}/string
@@ -95,6 +95,26 @@ strrchr.so: rindex.c
-o ${.TARGET}
.endif
+# build .ln files for memmove, memcpy, strchr and strrchr always from
+# bcopy, index, and rindex
+LOBJS+= memmove.ln memcpy.ln strchr.ln strrchr.ln
+
+memmove.ln: bcopy.c
+ lint ${LINTFLAGS} -DMEMMOVE ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \
+ ${.CURDIR}/string/bcopy.c
+
+memcpy.ln: bcopy.c
+ lint ${LINTFLAGS} -DMEMCOPY ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \
+ ${.CURDIR}/string/bcopy.c
+
+strchr.ln: index.c
+ lint ${LINTFLAGS} -DSTRCHR ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \
+ ${.CURDIR}/string/index.c
+
+strrchr.ln: rindex.c
+ lint ${LINTFLAGS} -DSTRRCHR ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \
+ ${.CURDIR}/string/rindex.c
+
MAN+= bm.3 bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \
memcmp.3 memcpy.3 memmove.3 memset.3 rindex.3 strcasecmp.3 strcat.3 \
strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strerror.3 strftime.3 \
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index dfb229b6016..d2813e8612e 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -86,6 +86,11 @@ ${PSEUDO}: ${.CURDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
+LSRCS+= protolib.c
+
+protolib.ln:
+ ${LINT} ${LINTFLAGS} ${CFLAGS:M-[IDU]*} ${AINC} -i ${.IMPSRC}
+
MAN+= accept.2 access.2 acct.2 adjtime.2 bind.2 brk.2 chdir.2 chflags.2 \
chmod.2 chown.2 chroot.2 close.2 connect.2 dup.2 execve.2 _exit.2 \
fcntl.2 flock.2 fork.2 fsync.2 getdirentries.2 getfh.2 getfsstat.2 \
diff --git a/lib/libc/sys/protolib.c b/lib/libc/sys/protolib.c
new file mode 100644
index 00000000000..a4f7373f0e5
--- /dev/null
+++ b/lib/libc/sys/protolib.c
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 1995 Jochen Pohl
+ * 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 Jochen Pohl for
+ * The NetBSD Project.
+ * 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.
+ *
+ * $OpenBSD: protolib.c,v 1.1 1996/03/25 23:31:48 tholo Exp $
+ */
+
+#ifndef lint
+static char rcsid[] = "$OpenBSD: protolib.c,v 1.1 1996/03/25 23:31:48 tholo Exp $";
+#endif
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/uio.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
+#include <sys/ktrace.h>
+#include <sys/mount.h>
+#include <sys/msg.h>
+#include <sys/mman.h>
+#include <sys/ptrace.h>
+#include <sys/resource.h>
+#include <sys/sem.h>
+#include <sys/shm.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "protolib.h"
+
+/*
+ * Don't include anything after protolib.h,
+ * both LINTLIBRARY and PROTOLIB1 are active.
+ */
+
+int syscall(int, ...); /* 0 */
+void _exit(int); /* 1 */
+pid_t fork(void); /* 2 */
+ssize_t read(int, void *, size_t); /* 3 */
+ssize_t write(int, const void *, size_t); /* 4 */
+int open(const char *, int, ...); /* 5 */
+int close(int); /* 6 */
+pid_t wait4(pid_t, int *, int, struct rusage *); /* 7 */
+
+int link(const char *, const char *); /* 9 */
+int unlink(const char *); /* 10 */
+
+int chdir(const char *); /* 12 */
+int fchdir(int); /* 13 */
+int mknod(const char *, mode_t, dev_t); /* 14 */
+int chmod(const char *, mode_t); /* 15 */
+int chown(const char *, uid_t, gid_t); /* 16 */
+char *brk(const char *); /* 17 */
+int getfsstat(struct statfs *, long, int); /* 18 */
+
+pid_t getpid(void); /* 20 */
+int mount(const char *, const char *, int, void *); /* 21 */
+int unmount(const char *, int); /* 22 */
+int setuid(uid_t); /* 23 */
+uid_t getuid(void); /* 24 */
+uid_t geteuid(void); /* 25 */
+int ptrace(int, pid_t, caddr_t, int); /* 26 */
+ssize_t recvmsg(int, struct msghdr *, int); /* 27 */
+ssize_t sendmsg(int, const struct msghdr *, int); /* 28 */
+ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, /* 29 */
+ int *);
+int accept(int, struct sockaddr *, int *); /* 30 */
+int getpeername(int, struct sockaddr *, int *); /* 31 */
+int getsockname(int, struct sockaddr *, int *); /* 32 */
+int access(const char *, int); /* 33 */
+int chflags(const char *, u_long); /* 34 */
+int fchflags(int, u_long); /* 35 */
+void sync(void); /* 36 */
+int kill(pid_t, int); /* 37 */
+
+pid_t getppid(void); /* 39 */
+
+int dup(int); /* 41 */
+int pipe(int *); /* 42 */
+gid_t getegid(void); /* 43 */
+int profil(char *, size_t, u_long, u_int); /* 44 */
+int ktrace(const char *, int, int, pid_t); /* 45 */
+int sigaction(int, const struct sigaction *, /* 46 */
+ struct sigaction *);
+gid_t getgid(void); /* 47 */
+int sigprocmask(int, const sigset_t *, sigset_t *); /* 48 */
+int _getlogin(char *, u_int); /* 49 */
+int setlogin(const char *); /* 50 */
+int acct(const char *); /* 51 */
+int sigpending(sigset_t *); /* 52 */
+int sigaltstack(const struct sigaltstack *, /* 53 */
+ struct sigaltstack *);
+int ioctl(int, u_long, ...); /* 54 */
+int reboot(int); /* 55 */
+int revoke(const char *); /* 56 */
+int symlink(const char *, const char *); /* 57 */
+int readlink(const char *, char *, int); /* 58 */
+int execve(const char *, char *const [], char *const []); /* 59 */
+mode_t umask(mode_t); /* 60 */
+int chroot(const char *); /* 61 */
+
+int msync(caddr_t, size_t); /* 65 */
+pid_t vfork(void); /* 66 */
+
+char *sbrk(int); /* 69 */
+char *sstk(int); /* 70 */
+
+int vadvise(int); /* 72 */
+int munmap(caddr_t, size_t); /* 73 */
+int mprotect(caddr_t, size_t, int); /* 74 */
+int madvise(caddr_t, size_t, int); /* 75 */
+
+int mincore(caddr_t, size_t, char *); /* 78 */
+int getgroups(int, gid_t *); /* 79 */
+int setgroups(int, const gid_t *); /* 80 */
+pid_t getpgrp(void); /* 81 */
+int setpgid(pid_t, pid_t); /* 82 */
+int setitimer(int, const struct itimerval *, /* 83 */
+ struct itimerval *);
+
+int swapon(const char *); /* 85 */
+int getitimer(int, struct itimerval *); /* 86 */
+
+int dup2(int, int); /* 90 */
+
+int fcntl(int, int, ...); /* 92 */
+int select(int, fd_set *, fd_set *, fd_set *, /* 93 */
+ struct timeval *);
+
+int fsync(int); /* 95 */
+int setpriority(int, int, int); /* 96 */
+int socket(int, int, int); /* 97 */
+int connect(int, const struct sockaddr *, int); /* 98 */
+
+int getpriority(int, int); /* 100 */
+
+int sigreturn(struct sigcontext *); /* 103 */
+int bind(int, const struct sockaddr *, int); /* 104 */
+int setsockopt(int, int, int, const void *, int); /* 105 */
+int listen(int, int); /* 106 */
+
+int sigsuspend(const sigset_t *); /* 111 */
+
+int vtrace(int, int); /* 115 */
+int gettimeofday(struct timeval *, struct timezone *); /* 116 */
+int getrusage(int, struct rusage *); /* 117 */
+int getsockopt(int, int, int, void *, int *); /* 118 */
+
+ssize_t readv(int, const struct iovec *, int); /* 120 */
+ssize_t writev(int, const struct iovec *, int); /* 121 */
+int settimeofday(const struct timeval *, /* 122 */
+ const struct timezone *);
+int fchown(int, uid_t, gid_t); /* 123 */
+int fchmod(int, mode_t); /* 124 */
+
+int rename(const char *, const char *); /* 128 */
+
+int flock(int, int); /* 131 */
+int mkfifo(const char *, mode_t); /* 132 */
+ssize_t sendto(int, const void *, size_t, int, /* 133 */
+ const struct sockaddr *, int);
+int shutdown(int, int); /* 134 */
+int socketpair(int, int, int, int *); /* 135 */
+int mkdir(const char *, mode_t); /* 136 */
+int rmdir(const char *); /* 137 */
+int utimes(const char *, const struct timeval *); /* 138 */
+
+int adjtime(const struct timeval *, struct timeval *); /* 140 */
+
+pid_t setsid(void); /* 147 */
+int quotactl(const char *, int, int, char *); /* 148 */
+
+int nfssvc(int, void *); /* 155 */
+
+int statfs(const char *, struct statfs *); /* 157 */
+int fstatfs(int, struct statfs *); /* 158 */
+
+int getfh(const char *, fhandle_t *); /* 161 */
+
+int sysarch(int, char *); /* 165 */
+
+int ntp_adjtime(struct timex *); /* 176 */
+int ntp_gettime(struct ntptimeval *); /* 177 */
+
+int setgid(gid_t); /* 181 */
+int setegid(gid_t); /* 182 */
+int seteuid(uid_t); /* 183 */
+int lfs_bmapv(fsid_t *, struct block_info *, int); /* 184 */
+int lfs_markv(fsid_t *, struct block_info *, int); /* 185 */
+int lfs_segclean(fsid_t *, u_long); /* 186 */
+int lfs_segwait(fsid_t *, struct timeval *); /* 187 */
+int stat(const char *, struct stat *); /* 188 */
+int fstat(int, struct stat *); /* 189 */
+int lstat(const char *, struct stat *); /* 190 */
+long pathconf(const char *, int); /* 191 */
+long fpathconf(int, int); /* 192 */
+
+int getrlimit(int, struct rlimit *); /* 194 */
+int setrlimit(int, const struct rlimit *); /* 195 */
+int getdirentries(int, char *, int, long *); /* 196 */
+
+quad_t __syscall(quad_t, ...); /* 198 */
+
+int __sysctl(int *, u_int, void *, size_t *, void *, /* 202 */
+ size_t);
+int mlock(caddr_t, size_t); /* 203 */
+int munlock(caddr_t, size_t); /* 204 */
+int undelete(const char *); /* 205 */
+
+int __semctl(int, int, int, union semun *); /* 220 */
+int semget(key_t, int, int); /* 221 */
+int semop(int, struct sembuf *, u_int); /* 222 */
+int semconfig(int); /* 223 */
+int msgctl(int, int, struct msqid_ds *); /* 224 */
+int msgget(key_t, int); /* 225 */
+int msgsnd(int, void *, size_t, int); /* 226 */
+int msgrcv(int, void *, size_t, long, int); /* 227 */
+void *shmat(int, void *, int); /* 228 */
+int shmctl(int, int, struct shmid_ds *); /* 229 */
+int shmdt(void *); /* 230 */
+int shmget(key_t, int, int); /* 231 */
+
+int minherit(caddr_t, size_t, int); /* 250 */
+int rfork(int); /* 251 */