sync with libc

This commit is contained in:
cgd 1998-03-27 01:29:58 +00:00
parent e989882802
commit 33b3e7101b
42 changed files with 417 additions and 233 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: adddi3.c,v 1.5 1995/10/07 09:26:14 mycroft Exp $ */
/* $NetBSD: adddi3.c,v 1.6 1998/03/27 01:29:58 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)adddi3.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: adddi3.c,v 1.5 1995/10/07 09:26:14 mycroft Exp $";
__RCSID("$NetBSD: adddi3.c,v 1.6 1998/03/27 01:29:58 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: anddi3.c,v 1.5 1995/10/07 09:26:15 mycroft Exp $ */
/* $NetBSD: anddi3.c,v 1.6 1998/03/27 01:29:58 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)anddi3.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: anddi3.c,v 1.5 1995/10/07 09:26:15 mycroft Exp $";
__RCSID("$NetBSD: anddi3.c,v 1.6 1998/03/27 01:29:58 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ashldi3.c,v 1.5 1995/10/07 09:26:17 mycroft Exp $ */
/* $NetBSD: ashldi3.c,v 1.6 1998/03/27 01:29:58 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)ashldi3.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: ashldi3.c,v 1.5 1995/10/07 09:26:17 mycroft Exp $";
__RCSID("$NetBSD: ashldi3.c,v 1.6 1998/03/27 01:29:58 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -58,12 +59,13 @@ __ashldi3(a, shift)
{
union uu aa;
if (shift == 0)
return(a);
aa.q = a;
if (shift >= LONG_BITS) {
aa.ul[H] = shift >= QUAD_BITS ? 0 :
aa.ul[L] << (shift - LONG_BITS);
aa.ul[H] = aa.ul[L] << (shift - LONG_BITS);
aa.ul[L] = 0;
} else if (shift > 0) {
} else {
aa.ul[H] = (aa.ul[H] << shift) |
(aa.ul[L] >> (LONG_BITS - shift));
aa.ul[L] <<= shift;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ashrdi3.c,v 1.5 1995/10/07 09:26:18 mycroft Exp $ */
/* $NetBSD: ashrdi3.c,v 1.6 1998/03/27 01:29:59 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)ashrdi3.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: ashrdi3.c,v 1.5 1995/10/07 09:26:18 mycroft Exp $";
__RCSID("$NetBSD: ashrdi3.c,v 1.6 1998/03/27 01:29:59 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -57,6 +58,8 @@ __ashrdi3(a, shift)
{
union uu aa;
if (shift == 0)
return(a);
aa.q = a;
if (shift >= LONG_BITS) {
long s;
@ -69,10 +72,9 @@ __ashrdi3(a, shift)
* then 1 more, to get our answer.
*/
s = (aa.sl[H] >> (LONG_BITS - 1)) >> 1;
aa.ul[L] = shift >= QUAD_BITS ? s :
aa.sl[H] >> (shift - LONG_BITS);
aa.ul[L] = aa.sl[H] >> (shift - LONG_BITS);
aa.ul[H] = s;
} else if (shift > 0) {
} else {
aa.ul[L] = (aa.ul[L] >> shift) |
(aa.ul[H] << (LONG_BITS - shift));
aa.sl[H] >>= shift;

View File

@ -1,6 +1,8 @@
/* $NetBSD: bcmp.c,v 1.10 1998/03/27 01:29:59 cgd Exp $ */
/*
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved.
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -31,12 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)bcmp.c 5.6 (Berkeley) 2/24/91";*/
static char *rcsid = "$NetBSD: bcmp.c,v 1.9 1997/10/13 11:55:15 lukem Exp $";
#if 0
static char sccsid[] = "@(#)bcmp.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: bcmp.c,v 1.10 1998/03/27 01:29:59 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>
@ -48,9 +54,9 @@ static char *rcsid = "$NetBSD: bcmp.c,v 1.9 1997/10/13 11:55:15 lukem Exp $";
int
bcmp(b1, b2, length)
const void *b1, *b2;
register size_t length;
size_t length;
{
register const char *p1, *p2;
const char *p1, *p2;
if (length == 0)
return(0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcopy.c,v 1.2 1998/02/22 09:13:16 mycroft Exp $ */
/* $NetBSD: bcopy.c,v 1.3 1998/03/27 01:30:00 cgd Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -41,11 +41,11 @@
#if 0
static char sccsid[] = "@(#)bcopy.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: bcopy.c,v 1.2 1998/02/22 09:13:16 mycroft Exp $");
__RCSID("$NetBSD: bcopy.c,v 1.3 1998/03/27 01:30:00 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>

View File

@ -1,3 +1,5 @@
/* $NetBSD: bzero.c,v 1.8 1998/03/27 01:30:00 cgd Exp $ */
/*
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved.
@ -31,12 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)bzero.c 5.7 (Berkeley) 2/24/91";*/
static char *rcsid = "$NetBSD: bzero.c,v 1.7 1997/10/13 11:55:23 lukem Exp $";
#if 0
static char *sccsid = "@(#)bzero.c 5.7 (Berkeley) 2/24/91";
#else
__RCSID("$NetBSD: bzero.c,v 1.8 1998/03/27 01:30:00 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>
@ -48,9 +54,9 @@ static char *rcsid = "$NetBSD: bzero.c,v 1.7 1997/10/13 11:55:23 lukem Exp $";
void
bzero(b, length)
void *b;
register size_t length;
size_t length;
{
register char *p;
char *p;
for (p = b; length--;)
*p++ = '\0';

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmpdi2.c,v 1.5 1995/10/07 09:26:22 mycroft Exp $ */
/* $NetBSD: cmpdi2.c,v 1.6 1998/03/27 01:30:00 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)cmpdi2.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: cmpdi2.c,v 1.5 1995/10/07 09:26:22 mycroft Exp $";
__RCSID("$NetBSD: cmpdi2.c,v 1.6 1998/03/27 01:30:00 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: divdi3.c,v 1.5 1995/10/07 09:26:24 mycroft Exp $ */
/* $NetBSD: divdi3.c,v 1.6 1998/03/27 01:30:01 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)divdi3.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: divdi3.c,v 1.5 1995/10/07 09:26:24 mycroft Exp $";
__RCSID("$NetBSD: divdi3.c,v 1.6 1998/03/27 01:30:01 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -56,16 +57,18 @@ __divdi3(a, b)
quad_t a, b;
{
u_quad_t ua, ub, uq;
int neg;
int neg = 0;
ua = a;
ub = b;
if (a < 0)
ua = -(u_quad_t)a, neg = 1;
else
ua = a, neg = 0;
ua = -ua, neg ^= 1;
if (b < 0)
ub = -(u_quad_t)b, neg ^= 1;
else
ub = b;
ub = -ub, neg ^= 1;
uq = __qdivrem(ua, ub, (u_quad_t *)0);
return (neg ? -uq : uq);
if (neg)
uq = - uq;
return uq;
}

View File

@ -1,6 +1,8 @@
/* $NetBSD: ffs.c,v 1.8 1998/03/27 01:30:01 cgd Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -31,12 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)ffs.c 5.4 (Berkeley) 5/17/90";*/
static char *rcsid = "$NetBSD: ffs.c,v 1.7 1997/10/13 11:55:27 lukem Exp $";
#if 0
static char sccsid[] = "@(#)ffs.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: ffs.c,v 1.8 1998/03/27 01:30:01 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>
@ -47,9 +53,9 @@ static char *rcsid = "$NetBSD: ffs.c,v 1.7 1997/10/13 11:55:27 lukem Exp $";
*/
int
ffs(mask)
register int mask;
int mask;
{
register int bit;
int bit;
if (mask == 0)
return(0);

View File

@ -1,12 +1,13 @@
/* $NetBSD: htonl.c,v 1.8 1996/10/17 01:41:35 cgd Exp $ */
/* $NetBSD: htonl.c,v 1.9 1998/03/27 01:30:01 cgd Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$NetBSD: htonl.c,v 1.8 1996/10/17 01:41:35 cgd Exp $";
__RCSID("$NetBSD: htonl.c,v 1.9 1998/03/27 01:30:01 cgd Exp $");
#endif
#include <sys/types.h>

View File

@ -1,12 +1,13 @@
/* $NetBSD: htons.c,v 1.8 1996/10/17 01:41:37 cgd Exp $ */
/* $NetBSD: htons.c,v 1.9 1998/03/27 01:30:02 cgd Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$NetBSD: htons.c,v 1.8 1996/10/17 01:41:37 cgd Exp $";
__RCSID("$NetBSD: htons.c,v 1.9 1998/03/27 01:30:02 cgd Exp $");
#endif
#include <sys/types.h>

View File

@ -1,8 +1,8 @@
/* $NetBSD: index.c,v 1.2 1998/02/22 05:10:55 mycroft Exp $ */
/* $NetBSD: index.c,v 1.3 1998/03/27 01:30:02 cgd Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -33,16 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char *sccsid = "@(#)index.c 5.7 (Berkeley) 2/24/91";
static char sccsid[] = "@(#)index.c 8.1 (Berkeley) 6/4/93";
#else
#include <sys/cdefs.h>
__RCSID("$NetBSD: index.c,v 1.2 1998/02/22 05:10:55 mycroft Exp $");
__RCSID("$NetBSD: index.c,v 1.3 1998/03/27 01:30:02 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>
@ -55,7 +55,7 @@ strchr(p, ch)
#else
index(p, ch)
#endif
register const char *p, ch;
const char *p, ch;
{
for (;; ++p) {
if (*p == ch)

View File

@ -1,4 +1,4 @@
/* $NetBSD: iordi3.c,v 1.5 1995/10/07 09:26:28 mycroft Exp $ */
/* $NetBSD: iordi3.c,v 1.6 1998/03/27 01:30:02 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)iordi3.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: iordi3.c,v 1.5 1995/10/07 09:26:28 mycroft Exp $";
__RCSID("$NetBSD: iordi3.c,v 1.6 1998/03/27 01:30:02 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: lshldi3.c,v 1.5 1995/10/07 09:26:29 mycroft Exp $ */
/* $NetBSD: lshldi3.c,v 1.6 1998/03/27 01:30:03 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)lshldi3.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: lshldi3.c,v 1.5 1995/10/07 09:26:29 mycroft Exp $";
__RCSID("$NetBSD: lshldi3.c,v 1.6 1998/03/27 01:30:03 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -58,12 +59,13 @@ __lshldi3(a, shift)
{
union uu aa;
if (shift == 0)
return(a);
aa.q = a;
if (shift >= LONG_BITS) {
aa.ul[H] = shift >= QUAD_BITS ? 0 :
aa.ul[L] << (shift - LONG_BITS);
aa.ul[H] = aa.ul[L] << (shift - LONG_BITS);
aa.ul[L] = 0;
} else if (shift > 0) {
} else {
aa.ul[H] = (aa.ul[H] << shift) |
(aa.ul[L] >> (LONG_BITS - shift));
aa.ul[L] <<= shift;

View File

@ -1,4 +1,4 @@
/* $NetBSD: lshrdi3.c,v 1.5 1995/10/07 09:26:30 mycroft Exp $ */
/* $NetBSD: lshrdi3.c,v 1.6 1998/03/27 01:30:03 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)lshrdi3.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: lshrdi3.c,v 1.5 1995/10/07 09:26:30 mycroft Exp $";
__RCSID("$NetBSD: lshrdi3.c,v 1.6 1998/03/27 01:30:03 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -57,12 +58,13 @@ __lshrdi3(a, shift)
{
union uu aa;
if (shift == 0)
return(a);
aa.q = a;
if (shift >= LONG_BITS) {
aa.ul[L] = shift >= QUAD_BITS ? 0 :
aa.ul[H] >> (shift - LONG_BITS);
aa.ul[L] = aa.ul[H] >> (shift - LONG_BITS);
aa.ul[H] = 0;
} else if (shift > 0) {
} else {
aa.ul[L] = (aa.ul[L] >> shift) |
(aa.ul[H] << (LONG_BITS - shift));
aa.ul[H] >>= shift;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mcount.c,v 1.8 1996/12/07 12:58:25 fvdl Exp $ */
/* $NetBSD: mcount.c,v 1.9 1998/03/27 01:30:03 cgd Exp $ */
/*-
* Copyright (c) 1983, 1992, 1993
@ -33,11 +33,14 @@
* SUCH DAMAGE.
*/
/* If compiling for a standalone program, there is no profiling support. */
#if !defined(_STANDALONE)
#if !defined(lint) && !defined(_KERNEL) && defined(LIBC_SCCS)
#if 0
static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: mcount.c,v 1.8 1996/12/07 12:58:25 fvdl Exp $";
static char rcsid[] = "$NetBSD: mcount.c,v 1.9 1998/03/27 01:30:03 cgd Exp $";
#endif
#endif
@ -189,3 +192,5 @@ overflow:
* which is included by <sys/gmon.h>.
*/
MCOUNT
#endif /* !defined(_STANDALONE) */

View File

@ -1,4 +1,4 @@
/* $NetBSD: md5c.c,v 1.1 1997/04/30 00:53:02 thorpej Exp $ */
/* $NetBSD: md5c.c,v 1.2 1998/03/27 01:30:04 cgd Exp $ */
/*
* This file is derived from the RSA Data Security, Inc. MD5 Message-Digest
@ -31,24 +31,24 @@
#include <sys/types.h>
#ifdef _KERNEL
#if defined(_KERNEL) || defined(_STANDALONE)
#include <sys/systm.h>
#include <sys/md5.h>
#else
#include <string.h>
#include <md5.h>
#endif /* _KERNEL */
#endif /* _KERNEL || _STANDALONE */
/*
* XXX Kludge until there is resolution regarding mem*() functions
* XXX in the kernel.
*/
#ifdef _KERNEL
#if defined(_KERNEL) || defined(_STANDALONE)
#define memcpy(s, d, l) bcopy((d), (s), (l))
#define ZEROIZE(d, l) bzero((d), (l))
#else
#define ZEROIZE(d, l) memset((d), 0, (l))
#endif /* _KERNEL */
#endif /* _KERNEL || _STANDALONE */
typedef unsigned char *POINTER;
typedef u_int16_t UINT2;

View File

@ -1,8 +1,8 @@
/* $NetBSD: memchr.c,v 1.4 1998/02/22 05:10:55 mycroft Exp $ */
/* $NetBSD: memchr.c,v 1.5 1998/03/27 01:30:04 cgd Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
@ -36,16 +36,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char *sccsid = "@(#)memchr.c 5.6 (Berkeley) 1/26/91";
static char sccsid[] = "@(#)memchr.c 8.1 (Berkeley) 6/4/93";
#else
#include <sys/cdefs.h>
__RCSID("$NetBSD: memchr.c,v 1.4 1998/02/22 05:10:55 mycroft Exp $");
__RCSID("$NetBSD: memchr.c,v 1.5 1998/03/27 01:30:04 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>
@ -55,11 +55,11 @@ __RCSID("$NetBSD: memchr.c,v 1.4 1998/02/22 05:10:55 mycroft Exp $");
void *
memchr(s, c, n)
const void *s;
register unsigned char c;
register size_t n;
unsigned char c;
size_t n;
{
if (n != 0) {
register const unsigned char *p = s;
const unsigned char *p = s;
do {
if (*p++ == c)

View File

@ -1,6 +1,8 @@
/* $NetBSD: memcmp.c,v 1.3 1998/03/27 01:30:04 cgd Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
@ -34,12 +36,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)memcmp.c 5.6 (Berkeley) 1/26/91";*/
static char *rcsid = "$NetBSD: memcmp.c,v 1.2 1997/10/13 11:55:32 lukem Exp $";
#if 0
static char sccsid[] = "@(#)memcmp.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: memcmp.c,v 1.3 1998/03/27 01:30:04 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>
@ -54,7 +60,7 @@ memcmp(s1, s2, n)
size_t n;
{
if (n != 0) {
register const unsigned char *p1 = s1, *p2 = s2;
const unsigned char *p1 = s1, *p2 = s2;
do {
if (*p1++ != *p2++)

View File

@ -1,9 +1,11 @@
/* $NetBSD: memset.c,v 1.5 1998/03/27 01:30:05 cgd Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
* Mike Hibler and Chris Torek.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -34,30 +36,107 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)memset.c 5.6 (Berkeley) 1/26/91";*/
static char *rcsid = "$NetBSD: memset.c,v 1.4 1997/10/13 11:55:37 lukem Exp $";
#if 0
static char sccsid[] = "@(#)memset.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: memset.c,v 1.5 1998/03/27 01:30:05 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#include <sys/types.h>
#include <limits.h>
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>
#endif
#define wsize sizeof(u_int)
#define wmask (wsize - 1)
#ifdef BZERO
#define RETURN return
#define VAL 0
#define WIDEVAL 0
void
bzero(dst0, length)
void *dst0;
size_t length;
#else
#define RETURN return (dst0)
#define VAL c0
#define WIDEVAL c
void *
memset(dst, c, n)
void *dst;
register int c;
register size_t n;
memset(dst0, c0, length)
void *dst0;
int c0;
size_t length;
#endif
{
size_t t;
u_int c;
u_char *dst;
if (n != 0) {
register char *d = dst;
do
*d++ = c;
while (--n != 0);
dst = dst0;
/*
* If not enough words, just fill bytes. A length >= 2 words
* guarantees that at least one of them is `complete' after
* any necessary alignment. For instance:
*
* |-----------|-----------|-----------|
* |00|01|02|03|04|05|06|07|08|09|0A|00|
* ^---------------------^
* dst dst+length-1
*
* but we use a minimum of 3 here since the overhead of the code
* to do word writes is substantial.
*/
if (length < 3 * wsize) {
while (length != 0) {
*dst++ = VAL;
--length;
}
RETURN;
}
return (dst);
#ifndef BZERO
if ((c = (u_char)c0) != 0) { /* Fill the word. */
c = (c << 8) | c; /* u_int is 16 bits. */
#if UINT_MAX > 0xffff
c = (c << 16) | c; /* u_int is 32 bits. */
#endif
#if UINT_MAX > 0xffffffff
c = (c << 32) | c; /* u_int is 64 bits. */
#endif
}
#endif
/* Align destination by filling in bytes. */
if ((t = (u_long)dst & wmask) != 0) {
t = wsize - t;
length -= t;
do {
*dst++ = VAL;
} while (--t != 0);
}
/* Fill words. Length was >= 2*words so we know t >= 1 here. */
t = length / wsize;
do {
*(u_int *)dst = WIDEVAL;
dst += wsize;
} while (--t != 0);
/* Mop up trailing bytes, if any. */
t = length & wmask;
if (t != 0)
do {
*dst++ = VAL;
} while (--t != 0);
RETURN;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: moddi3.c,v 1.5 1995/10/07 09:26:31 mycroft Exp $ */
/* $NetBSD: moddi3.c,v 1.6 1998/03/27 01:30:05 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)moddi3.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: moddi3.c,v 1.5 1995/10/07 09:26:31 mycroft Exp $";
__RCSID("$NetBSD: moddi3.c,v 1.6 1998/03/27 01:30:05 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -50,24 +51,24 @@ static char rcsid[] = "$NetBSD: moddi3.c,v 1.5 1995/10/07 09:26:31 mycroft Exp $
/*
* Return remainder after dividing two signed quads.
*
* XXX
* If -1/2 should produce -1 on this machine, this code is wrong.
* XXX we assume a % b < 0 iff a < 0, but this is actually machine-dependent.
*/
quad_t
__moddi3(a, b)
quad_t a, b;
{
u_quad_t ua, ub, ur;
int neg;
int neg = 0;
ua = a;
ub = b;
if (a < 0)
ua = -(u_quad_t)a, neg = 1;
else
ua = a, neg = 0;
ua = -ua, neg ^= 1;
if (b < 0)
ub = -(u_quad_t)b, neg ^= 1;
else
ub = b;
ub = -ub;
(void)__qdivrem(ua, ub, &ur);
return (neg ? -ur : ur);
if (neg)
ur = -ur;
return (ur);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: muldi3.c,v 1.5 1995/10/07 09:26:33 mycroft Exp $ */
/* $NetBSD: muldi3.c,v 1.6 1998/03/27 01:30:05 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)muldi3.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: muldi3.c,v 1.5 1995/10/07 09:26:33 mycroft Exp $";
__RCSID("$NetBSD: muldi3.c,v 1.6 1998/03/27 01:30:05 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -111,8 +112,8 @@ __muldi3(a, b)
quad_t a, b;
{
union uu u, v, low, prod;
register u_long high, mid, udiff, vdiff;
register int negall, negmid;
u_long high, mid, udiff, vdiff;
int negall, negmid;
#define u1 u.ul[H]
#define u0 u.ul[L]
#define v1 v.ul[H]

View File

@ -1,4 +1,4 @@
/* $NetBSD: negdi2.c,v 1.5 1995/10/07 09:26:34 mycroft Exp $ */
/* $NetBSD: negdi2.c,v 1.6 1998/03/27 01:30:06 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)negdi2.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: negdi2.c,v 1.5 1995/10/07 09:26:34 mycroft Exp $";
__RCSID("$NetBSD: negdi2.c,v 1.6 1998/03/27 01:30:06 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: notdi2.c,v 1.5 1995/10/07 09:26:36 mycroft Exp $ */
/* $NetBSD: notdi2.c,v 1.6 1998/03/27 01:30:06 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)notdi2.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: notdi2.c,v 1.5 1995/10/07 09:26:36 mycroft Exp $";
__RCSID("$NetBSD: notdi2.c,v 1.6 1998/03/27 01:30:06 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */

View File

@ -1,12 +1,13 @@
/* $NetBSD: ntohl.c,v 1.8 1996/10/17 01:41:39 cgd Exp $ */
/* $NetBSD: ntohl.c,v 1.9 1998/03/27 01:30:06 cgd Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$NetBSD: ntohl.c,v 1.8 1996/10/17 01:41:39 cgd Exp $";
__RCSID("$NetBSD: ntohl.c,v 1.9 1998/03/27 01:30:06 cgd Exp $");
#endif
#include <sys/types.h>

View File

@ -1,12 +1,13 @@
/* $NetBSD: ntohs.c,v 1.7 1996/10/17 01:41:41 cgd Exp $ */
/* $NetBSD: ntohs.c,v 1.8 1998/03/27 01:30:07 cgd Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$NetBSD: ntohs.c,v 1.7 1996/10/17 01:41:41 cgd Exp $";
__RCSID("$NetBSD: ntohs.c,v 1.8 1998/03/27 01:30:07 cgd Exp $");
#endif
#include <sys/types.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: qdivrem.c,v 1.5 1995/10/07 09:26:40 mycroft Exp $ */
/* $NetBSD: qdivrem.c,v 1.6 1998/03/27 01:30:07 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,13 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#ifdef notdef
#if 0
static char sccsid[] = "@(#)qdivrem.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: qdivrem.c,v 1.6 1998/03/27 01:30:07 cgd Exp $");
#endif
static char rcsid[] = "$NetBSD: qdivrem.c,v 1.5 1995/10/07 09:26:40 mycroft Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@ -79,7 +81,7 @@ __qdivrem(uq, vq, arq)
{
union uu tmp;
digit *u, *v, *q;
register digit v1, v2;
digit v1, v2;
u_long qhat, rhat, t;
int m, n, d, j, i;
digit uspace[5], vspace[5], qspace[5];
@ -189,7 +191,7 @@ __qdivrem(uq, vq, arq)
v1 = v[1]; /* for D3 -- note that v[1..n] are constant */
v2 = v[2]; /* for D3 */
do {
register digit uj0, uj1, uj2;
digit uj0, uj1, uj2;
/*
* D3: Calculate qhat (\^q, in TeX notation).
@ -276,9 +278,9 @@ __qdivrem(uq, vq, arq)
* We may assume len >= 0. NOTE THAT THIS WRITES len+1 DIGITS.
*/
static void
shl(register digit *p, register int len, register int sh)
shl(digit *p, int len, int sh)
{
register int i;
int i;
for (i = 0; i < len; i++)
p[i] = LHALF(p[i] << sh) | (p[i + 1] >> (HALF_BITS - sh));

View File

@ -1,4 +1,4 @@
/* $NetBSD: quad.h,v 1.7 1996/04/18 02:20:04 cgd Exp $ */
/* $NetBSD: quad.h,v 1.8 1998/03/27 01:30:08 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -56,7 +56,7 @@
*/
#include <sys/types.h>
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <limits.h>
#else
#include <machine/limits.h>
@ -101,8 +101,6 @@ union uu {
#define LHALF(x) ((u_long)(x) & (((long)1 << HALF_BITS) - 1))
#define LHUP(x) ((u_long)(x) << HALF_BITS)
extern u_quad_t __qdivrem __P((u_quad_t u, u_quad_t v, u_quad_t *rem));
/*
* XXX
* Compensate for gcc 1 vs gcc 2. Gcc 1 defines ?sh?di3's second argument
@ -116,22 +114,31 @@ typedef u_quad_t qshift_t;
#endif
__BEGIN_DECLS
quad_t __adddi3 __P((quad_t, quad_t));
quad_t __anddi3 __P((quad_t, quad_t));
quad_t __ashldi3 __P((quad_t, qshift_t));
quad_t __ashrdi3 __P((quad_t, qshift_t));
int __cmpdi2 __P((quad_t, quad_t));
quad_t __divdi3 __P((quad_t, quad_t));
quad_t __iordi3 __P((quad_t, quad_t));
quad_t __lshldi3 __P((quad_t, qshift_t));
quad_t __lshrdi3 __P((quad_t, qshift_t));
quad_t __moddi3 __P((quad_t, quad_t));
quad_t __muldi3 __P((quad_t, quad_t));
quad_t __negdi2 __P((quad_t));
quad_t __one_cmpldi2 __P((quad_t));
quad_t __subdi3 __P((quad_t, quad_t));
int __ucmpdi2 __P((u_quad_t, u_quad_t));
u_quad_t __udivdi3 __P((u_quad_t, u_quad_t));
u_quad_t __umoddi3 __P((u_quad_t, u_quad_t));
quad_t __xordi3 __P((quad_t, quad_t));
int __cmpdi2 __P((quad_t, quad_t));
quad_t __adddi3 __P((quad_t, quad_t));
quad_t __anddi3 __P((quad_t, quad_t));
quad_t __ashldi3 __P((quad_t, qshift_t));
quad_t __ashrdi3 __P((quad_t, qshift_t));
int __cmpdi2 __P((quad_t, quad_t ));
quad_t __divdi3 __P((quad_t, quad_t));
quad_t __fixdfdi __P((double));
quad_t __fixsfdi __P((float));
u_quad_t __fixunsdfdi __P((double));
u_quad_t __fixunssfdi __P((float));
double __floatdidf __P((quad_t));
float __floatdisf __P((quad_t));
double __floatunsdidf __P((u_quad_t));
quad_t __iordi3 __P((quad_t, quad_t));
quad_t __lshldi3 __P((quad_t, qshift_t));
quad_t __lshrdi3 __P((quad_t, qshift_t));
quad_t __moddi3 __P((quad_t, quad_t));
quad_t __muldi3 __P((quad_t, quad_t));
quad_t __negdi2 __P((quad_t));
quad_t __one_cmpldi2 __P((quad_t));
u_quad_t __qdivrem __P((u_quad_t, u_quad_t, u_quad_t *));
quad_t __subdi3 __P((quad_t, quad_t));
int __ucmpdi2 __P((u_quad_t, u_quad_t));
u_quad_t __udivdi3 __P((u_quad_t, u_quad_t ));
u_quad_t __umoddi3 __P((u_quad_t, u_quad_t ));
quad_t __xordi3 __P((quad_t, quad_t));
__END_DECLS

View File

@ -1,8 +1,8 @@
/* $NetBSD: rindex.c,v 1.2 1998/02/22 05:10:55 mycroft Exp $ */
/* $NetBSD: rindex.c,v 1.3 1998/03/27 01:30:08 cgd Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -33,16 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char *sccsid = "@(#)rindex.c 5.9 (Berkeley) 2/24/91";
static char sccsid[] = "@(#)rindex.c 8.1 (Berkeley) 6/4/93";
#else
#include <sys/cdefs.h>
__RCSID("$NetBSD: rindex.c,v 1.2 1998/02/22 05:10:55 mycroft Exp $");
__RCSID("$NetBSD: rindex.c,v 1.3 1998/03/27 01:30:08 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>
@ -55,9 +55,10 @@ strrchr(p, ch)
#else
rindex(p, ch)
#endif
register const char *p, ch;
const char *p;
int ch;
{
register char *save;
char *save;
for (save = NULL;; ++p) {
if (*p == ch)

View File

@ -1,6 +1,8 @@
/* $NetBSD: strcat.c,v 1.9 1998/03/27 01:30:08 cgd Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -31,12 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)strcat.c 5.6 (Berkeley) 2/24/91";*/
static char *rcsid = "$NetBSD: strcat.c,v 1.8 1997/10/13 11:55:41 lukem Exp $";
#if 0
static char sccsid[] = "@(#)strcat.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: strcat.c,v 1.9 1998/03/27 01:30:08 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>
@ -44,12 +50,14 @@ static char *rcsid = "$NetBSD: strcat.c,v 1.8 1997/10/13 11:55:41 lukem Exp $";
char *
strcat(s, append)
register char *s;
register const char *append;
char *s;
const char *append;
{
char *save = s;
char *t = s;
for (; *s; ++s);
while ((*s++ = *append++) != '\0');
return(save);
for (; *t; ++t)
;
while ((*t++ = *append++) != '\0')
;
return (s);
}

View File

@ -1,6 +1,8 @@
/* $NetBSD: strcmp.c,v 1.9 1998/03/27 01:30:09 cgd Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
@ -34,12 +36,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)strcmp.c 5.5 (Berkeley) 1/26/91";*/
static char *rcsid = "$NetBSD: strcmp.c,v 1.8 1997/10/13 11:55:51 lukem Exp $";
#if 0
static char sccsid[] = "@(#)strcmp.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: strcmp.c,v 1.9 1998/03/27 01:30:09 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>
@ -50,7 +56,7 @@ static char *rcsid = "$NetBSD: strcmp.c,v 1.8 1997/10/13 11:55:51 lukem Exp $";
*/
int
strcmp(s1, s2)
register const char *s1, *s2;
const char *s1, *s2;
{
while (*s1 == *s2++)
if (*s1++ == 0)

View File

@ -1,6 +1,8 @@
/* $NetBSD: strcpy.c,v 1.9 1998/03/27 01:30:09 cgd Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -31,12 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)strcpy.c 5.7 (Berkeley) 2/24/91";*/
static char *rcsid = "$NetBSD: strcpy.c,v 1.8 1997/10/13 11:55:54 lukem Exp $";
#if 0
static char sccsid[] = "@(#)strcpy.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: strcpy.c,v 1.9 1998/03/27 01:30:09 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>
@ -44,8 +50,8 @@ static char *rcsid = "$NetBSD: strcpy.c,v 1.8 1997/10/13 11:55:54 lukem Exp $";
char *
strcpy(to, from)
register char *to;
register const char *from;
char *to;
const char *from;
{
char *save = to;

View File

@ -1,6 +1,8 @@
/* $NetBSD: strlen.c,v 1.8 1998/03/27 01:30:10 cgd Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -31,12 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)strlen.c 5.5 (Berkeley) 1/26/91";*/
static char *rcsid = "$NetBSD: strlen.c,v 1.7 1997/10/13 11:55:59 lukem Exp $";
#if 0
static char sccsid[] = "@(#)strlen.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: strlen.c,v 1.8 1998/03/27 01:30:10 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>
@ -46,7 +52,7 @@ size_t
strlen(str)
const char *str;
{
register const char *s;
const char *s;
for (s = str; *s; ++s);
return(s - str);

View File

@ -28,13 +28,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$NetBSD: strncasecmp.c,v 1.4 1997/10/13 11:56:03 lukem Exp $";
static char *rcsid = "$NetBSD: strncasecmp.c,v 1.5 1998/03/27 01:30:10 cgd Exp $";
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#include <string.h>
#else
#if defined(_KERNEL) || defined(_STANDALONE)
#include <lib/libkern/libkern.h>
#else
#include <string.h>
#endif
int

View File

@ -1,6 +1,8 @@
/* $NetBSD: strncmp.c,v 1.9 1998/03/27 01:30:10 cgd Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -31,12 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)strncmp.c 5.6 (Berkeley) 1/26/91";*/
static char *rcsid = "$NetBSD: strncmp.c,v 1.8 1997/10/13 11:56:07 lukem Exp $";
#if 0
static char sccsid[] = "@(#)strncmp.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: strncmp.c,v 1.9 1998/03/27 01:30:10 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>
@ -44,8 +50,8 @@ static char *rcsid = "$NetBSD: strncmp.c,v 1.8 1997/10/13 11:56:07 lukem Exp $";
int
strncmp(s1, s2, n)
register const char *s1, *s2;
register size_t n;
const char *s1, *s2;
size_t n;
{
if (n == 0)

View File

@ -1,6 +1,8 @@
/* $NetBSD: strncpy.c,v 1.8 1998/03/27 01:30:12 cgd Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
@ -34,12 +36,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)strncpy.c 5.6 (Berkeley) 1/26/91";*/
static char *rcsid = "$NetBSD: strncpy.c,v 1.7 1997/10/13 11:56:12 lukem Exp $";
#if 0
static char sccsid[] = "@(#)strncpy.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: strncpy.c,v 1.8 1998/03/27 01:30:12 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
#else
#include <lib/libkern/libkern.h>
@ -53,11 +59,11 @@ char *
strncpy(dst, src, n)
char *dst;
const char *src;
register size_t n;
size_t n;
{
if (n != 0) {
register char *d = dst;
register const char *s = src;
char *d = dst;
const char *s = src;
do {
if ((*d++ = *s++) == 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: subdi3.c,v 1.5 1995/10/07 09:26:52 mycroft Exp $ */
/* $NetBSD: subdi3.c,v 1.6 1998/03/27 01:30:12 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)subdi3.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: subdi3.c,v 1.5 1995/10/07 09:26:52 mycroft Exp $";
__RCSID("$NetBSD: subdi3.c,v 1.6 1998/03/27 01:30:12 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ucmpdi2.c,v 1.5 1995/10/07 09:26:53 mycroft Exp $ */
/* $NetBSD: ucmpdi2.c,v 1.6 1998/03/27 01:30:12 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)ucmpdi2.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: ucmpdi2.c,v 1.5 1995/10/07 09:26:53 mycroft Exp $";
__RCSID("$NetBSD: ucmpdi2.c,v 1.6 1998/03/27 01:30:12 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: udivdi3.c,v 1.5 1995/10/07 09:26:54 mycroft Exp $ */
/* $NetBSD: udivdi3.c,v 1.6 1998/03/27 01:30:13 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)udivdi3.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: udivdi3.c,v 1.5 1995/10/07 09:26:54 mycroft Exp $";
__RCSID("$NetBSD: udivdi3.c,v 1.6 1998/03/27 01:30:13 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: umoddi3.c,v 1.5 1995/10/07 09:26:55 mycroft Exp $ */
/* $NetBSD: umoddi3.c,v 1.6 1998/03/27 01:30:13 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)umoddi3.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: umoddi3.c,v 1.5 1995/10/07 09:26:55 mycroft Exp $";
__RCSID("$NetBSD: umoddi3.c,v 1.6 1998/03/27 01:30:13 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: xordi3.c,v 1.5 1995/10/07 09:26:56 mycroft Exp $ */
/* $NetBSD: xordi3.c,v 1.6 1998/03/27 01:30:14 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,11 +37,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)xordi3.c 8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: xordi3.c,v 1.5 1995/10/07 09:26:56 mycroft Exp $";
__RCSID("$NetBSD: xordi3.c,v 1.6 1998/03/27 01:30:14 cgd Exp $");
#endif
#endif /* LIBC_SCCS and not lint */