1163533Simp/*-
2163533Simp * Copyright (c) 2006 M. Warner Losh.  All rights reserved.
3163533Simp *
4163533Simp * Redistribution and use in source and binary forms, with or without
5163533Simp * modification, are permitted provided that the following conditions
6163533Simp * are met:
7163533Simp * 1. Redistributions of source code must retain the above copyright
8163533Simp *    notice, this list of conditions and the following disclaimer.
9163533Simp * 2. Redistributions in binary form must reproduce the above copyright
10163533Simp *    notice, this list of conditions and the following disclaimer in the
11163533Simp *    documentation and/or other materials provided with the distribution.
12163533Simp *
13163533Simp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14163533Simp * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15163533Simp * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16163533Simp * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17163533Simp * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18163533Simp * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19163533Simp * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20163533Simp * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21163533Simp * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22163533Simp * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23163533Simp *
24163533Simp */
25164137Simp
26164137Simp#include <sys/cdefs.h>
27164137Simp__FBSDID("$FreeBSD$");
28164137Simp
29163533Simp#include "lib.h"
30163533Simp
31163533Simpint
32163533Simpp_memcmp(const char *to, const char *from, unsigned size)
33163533Simp{
34163533Simp	while ((--size) && (*to++ == *from++))
35163533Simp		continue;
36163533Simp
37168006Simp	return (size || (*to != *from));
38163533Simp}
39