-/* $NetBSD: xdr_mem.c,v 1.3 1995/02/25 03:02:07 cgd Exp $ */
+/* $OpenBSD: xdr_mem.c,v 1.2 1996/03/09 02:42:53 niklas Exp $ */
+/* $NetBSD: xdr_mem.c,v 1.4 1996/02/08 08:06:05 mycroft Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)xdr_mem.c 1.19 87/08/11 Copyr 1984 Sun Micro";*/
/*static char *sccsid = "from: @(#)xdr_mem.c 2.1 88/07/29 4.0 RPCSRC";*/
-static char *rcsid = "$NetBSD: xdr_mem.c,v 1.3 1995/02/25 03:02:07 cgd Exp $";
+static char *rcsid = "$NetBSD: xdr_mem.c,v 1.4 1996/02/08 08:06:05 mycroft Exp $";
#endif
/*
#include <rpc/xdr.h>
#include <netinet/in.h>
-static bool_t xdrmem_getlong();
-static bool_t xdrmem_putlong();
+static bool_t xdrmem_getlong_aligned();
+static bool_t xdrmem_putlong_aligned();
+static bool_t xdrmem_getlong_unaligned();
+static bool_t xdrmem_putlong_unaligned();
static bool_t xdrmem_getbytes();
static bool_t xdrmem_putbytes();
static u_int xdrmem_getpos(); /* XXX w/64-bit pointers, u_int not enough! */
static bool_t xdrmem_setpos();
-static int32_t *xdrmem_inline();
+static int32_t *xdrmem_inline_aligned();
+static int32_t *xdrmem_inline_unaligned();
static void xdrmem_destroy();
-static struct xdr_ops xdrmem_ops = {
- xdrmem_getlong,
- xdrmem_putlong,
+static struct xdr_ops xdrmem_ops_aligned = {
+ xdrmem_getlong_aligned,
+ xdrmem_putlong_aligned,
xdrmem_getbytes,
xdrmem_putbytes,
xdrmem_getpos,
xdrmem_setpos,
- xdrmem_inline,
+ xdrmem_inline_aligned,
+ xdrmem_destroy
+};
+
+static struct xdr_ops xdrmem_ops_unaligned = {
+ xdrmem_getlong_unaligned,
+ xdrmem_putlong_unaligned,
+ xdrmem_getbytes,
+ xdrmem_putbytes,
+ xdrmem_getpos,
+ xdrmem_setpos,
+ xdrmem_inline_unaligned,
xdrmem_destroy
};
{
xdrs->x_op = op;
- xdrs->x_ops = &xdrmem_ops;
+ xdrs->x_ops = ((size_t)addr & (sizeof(int32_t) - 1))
+ ? &xdrmem_ops_unaligned : &xdrmem_ops_aligned;
xdrs->x_private = xdrs->x_base = addr;
xdrs->x_handy = size;
}
xdrmem_destroy(/*xdrs*/)
/*XDR *xdrs;*/
{
+
+}
+
+static bool_t
+xdrmem_getlong_aligned(xdrs, lp)
+ register XDR *xdrs;
+ long *lp;
+{
+
+ if ((xdrs->x_handy -= sizeof(int32_t)) < 0)
+ return (FALSE);
+ *lp = ntohl(*(int32_t *)xdrs->x_private);
+ xdrs->x_private += sizeof(int32_t);
+ return (TRUE);
}
static bool_t
-xdrmem_getlong(xdrs, lp)
+xdrmem_putlong_aligned(xdrs, lp)
register XDR *xdrs;
long *lp;
{
if ((xdrs->x_handy -= sizeof(int32_t)) < 0)
return (FALSE);
- *lp = (long)ntohl((u_int32_t)(*((int32_t *)(xdrs->x_private))));
+ *(int32_t *)xdrs->x_private = htonl(*lp);
xdrs->x_private += sizeof(int32_t);
return (TRUE);
}
static bool_t
-xdrmem_putlong(xdrs, lp)
+xdrmem_getlong_unaligned(xdrs, lp)
register XDR *xdrs;
long *lp;
{
+ int32_t l;
if ((xdrs->x_handy -= sizeof(int32_t)) < 0)
return (FALSE);
- *(int32_t *)xdrs->x_private = (int32_t)htonl((int32_t)(*lp));
+ bcopy(xdrs->x_private, &l, sizeof(int32_t));
+ *lp = ntohl(l);
+ xdrs->x_private += sizeof(int32_t);
+ return (TRUE);
+}
+
+static bool_t
+xdrmem_putlong_unaligned(xdrs, lp)
+ register XDR *xdrs;
+ long *lp;
+{
+ int32_t l;
+
+ if ((xdrs->x_handy -= sizeof(int32_t)) < 0)
+ return (FALSE);
+ l = htonl(*lp);
+ bcopy(&l, xdrs->x_private, sizeof(int32_t));
xdrs->x_private += sizeof(int32_t);
return (TRUE);
}
}
static int32_t *
-xdrmem_inline(xdrs, len)
+xdrmem_inline_aligned(xdrs, len)
register XDR *xdrs;
int len;
{
if (xdrs->x_handy >= len) {
xdrs->x_handy -= len;
- buf = (int32_t *) xdrs->x_private;
+ buf = (int32_t *)xdrs->x_private;
xdrs->x_private += len;
}
return (buf);
}
+
+static int32_t *
+xdrmem_inline_unaligned(xdrs, len)
+ register XDR *xdrs;
+ int len;
+{
+
+ return (0);
+}
+/* $OpenBSD: bcmp.c,v 1.2 1996/03/09 02:42:54 niklas Exp $ */
+
/*
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved.
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)bcmp.c 5.6 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id: bcmp.c,v 1.1.1.1 1995/10/18 08:42:20 deraadt Exp $";
+static char *rcsid = "$Id: bcmp.c,v 1.2 1996/03/09 02:42:54 niklas Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
/*
* bcmp -- vax cmpc3 instruction
*/
+int
bcmp(b1, b2, length)
const void *b1, *b2;
register size_t length;
+/* $OpenBSD: bm.c,v 1.2 1996/03/09 02:42:55 niklas Exp $ */
+
/*-
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
* SUCH DAMAGE.
*/
-#ifndef lint
-/* from: static char sccsid[] = "@(#)bm.c 8.7 (Berkeley) 6/21/94"; */
-static char *rcsid = "$Id: bm.c,v 1.1.1.1 1995/10/18 08:42:20 deraadt Exp $";
-#endif /* not lint */
+#if defined(LIBC_SCCS) && !defined(lint)
+/* from: static char sccsid[] = "@(#)bm.c 8.7 (Berkeley) 6/21/94"; */
+static char *rcsid = "$Id: bm.c,v 1.2 1996/03/09 02:42:55 niklas Exp $";
+#endif /* LIBC_SCCS && not lint */
#include <sys/types.h>
+/* $OpenBSD: strcat.c,v 1.2 1996/03/09 02:42:56 niklas Exp $ */
+
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)strcat.c 5.6 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id: strcat.c,v 1.1.1.1 1995/10/18 08:42:22 deraadt Exp $";
+static char *rcsid = "$Id: strcat.c,v 1.2 1996/03/09 02:42:56 niklas Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
char *save = s;
for (; *s; ++s);
- while (*s++ = *append++);
+ while ((*s++ = *append++) != '\0');
return(save);
}
+/* $OpenBSD: strcpy.c,v 1.2 1996/03/09 02:42:57 niklas Exp $ */
+
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)strcpy.c 5.7 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id: strcpy.c,v 1.1.1.1 1995/10/18 08:42:22 deraadt Exp $";
+static char *rcsid = "$Id: strcpy.c,v 1.2 1996/03/09 02:42:57 niklas Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
{
char *save = to;
- for (; *to = *from; ++from, ++to);
+ for (; (*to = *from) != '\0'; ++from, ++to);
return(save);
}
+/* $OpenBSD: strftime.c,v 1.3 1996/03/09 02:42:58 niklas Exp $ */
+
/*
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)strftime.c 5.11 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id: strftime.c,v 1.2 1995/12/30 08:16:41 deraadt Exp $";
+static char *rcsid = "$Id: strftime.c,v 1.3 1996/03/09 02:42:58 niklas Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/localedef.h>
return(gsize);
}
-static
+static int
_secs(t)
struct tm *t;
{
return(_add(++p));
}
-static
+static int
_conv(n, digits, pad)
int n, digits;
char pad;
return(_add(++p));
}
-static
+static int
_add(str)
register char *str;
{
-.\" $NetBSD: mount.2,v 1.10 1995/11/28 06:41:53 jtc Exp $
+.\" $OpenBSD: mount.2,v 1.4 1996/03/09 02:42:59 niklas Exp $
+.\" $NetBSD: mount.2,v 1.11 1996/02/08 18:33:58 mycroft Exp $
.\"
.\" Copyright (c) 1980, 1989, 1993
.\" The Regents of the University of California. All rights reserved.
.Fd #include <sys/param.h>
.Fd #include <sys/mount.h>
.Ft int
-.Fn mount "char *type" "const char *dir" "int flags" "void *data"
+.Fn mount "const char *type" "const char *dir" "int flags" "void *data"
.Ft int
.Fn unmount "const char *dir" "int flags"
.Sh DESCRIPTION
-/* $NetBSD: xdryp.c,v 1.9 1995/07/14 21:04:17 christos Exp $ */
+/* $OpenBSD: xdryp.c,v 1.3 1996/03/09 02:43:00 niklas Exp $ */
+/* $NetBSD: xdryp.c,v 1.10 1996/02/04 23:26:21 jtc Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* SUCH DAMAGE.
*/
-#ifndef LINT
-static char *rcsid = "$NetBSD: xdryp.c,v 1.9 1995/07/14 21:04:17 christos Exp $";
+#if defined(LIBC_SCCS) && !defined(lint)
+static char *rcsid = "$NetBSD: xdryp.c,v 1.10 1996/02/04 23:26:21 jtc Exp $";
#endif
#include <sys/param.h>
-/* $NetBSD: yplib.c,v 1.16 1995/07/14 21:04:24 christos Exp $ */
+/* $OpenBSD: yplib.c,v 1.4 1996/03/09 02:43:01 niklas Exp $ */
+/* $NetBSD: yplib.c,v 1.17 1996/02/04 23:26:26 jtc Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* SUCH DAMAGE.
*/
-#ifndef LINT
-static char rcsid[] = "$NetBSD: yplib.c,v 1.16 1995/07/14 21:04:24 christos Exp $";
+#if defined(LIBC_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: yplib.c,v 1.17 1996/02/04 23:26:26 jtc Exp $";
#endif
#include <sys/param.h>