summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc/port
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-09-28 11:50:59 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-09-28 11:50:59 +0000
commit6f23a9bc76766dec0e7ede5387a6652eacb50164 (patch)
tree91d0f9fe38dd2488dd25322a6a467cb01a2d7367 /usr/src/lib/libc/port
parent483cfaba9947c7223e1971a45f9b473b324689d9 (diff)
parent28de4f3c3209c81f9a96e2019d44a0b9adcb74cb (diff)
downloadillumos-joyent-6f23a9bc76766dec0e7ede5387a6652eacb50164.tar.gz
[illumos-gate merge]
commit 28de4f3c3209c81f9a96e2019d44a0b9adcb74cb 13173 loader: add strtoul, strtoull, memmem and abort commit 3e1c5f3a80260eb14c78730bcaca9e6c74f528a0 13030 remove 'retu' pattern from bhyve 13031 bhyve kernel should use proper struct types
Diffstat (limited to 'usr/src/lib/libc/port')
-rw-r--r--usr/src/lib/libc/port/gen/explicit_bzero.c21
-rw-r--r--usr/src/lib/libc/port/gen/memmem.c87
2 files changed, 0 insertions, 108 deletions
diff --git a/usr/src/lib/libc/port/gen/explicit_bzero.c b/usr/src/lib/libc/port/gen/explicit_bzero.c
deleted file mode 100644
index bcc7fa3f88..0000000000
--- a/usr/src/lib/libc/port/gen/explicit_bzero.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* $OpenBSD: explicit_bzero.c,v 1.3 2014/06/21 02:34:26 matthew Exp $ */
-/*
- * Public domain.
- * Written by Matthew Dempsky.
- */
-
-#include <string.h>
-
-#pragma weak __explicit_bzero_hook
-
-void
-__explicit_bzero_hook(void *buf __unused, size_t len __unused)
-{
-}
-
-void
-explicit_bzero(void *buf, size_t len)
-{
- (void) memset(buf, 0, len);
- __explicit_bzero_hook(buf, len);
-}
diff --git a/usr/src/lib/libc/port/gen/memmem.c b/usr/src/lib/libc/port/gen/memmem.c
deleted file mode 100644
index a0f396e7c4..0000000000
--- a/usr/src/lib/libc/port/gen/memmem.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Copyright (c) 2005 Pascal Gloor <pascal.gloor@spale.com>
- *
- * 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. 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
- */
-
-#include <string.h>
-
-/*
- * Find the first occurrence of the byte string s in byte string l.
- */
-
-void *
-memmem(const void *l, size_t l_len, const void *s, size_t s_len)
-{
- char *cur, *last;
- const char *cl = (const char *)l;
- const char *cs = (const char *)s;
-
- /* we need something to compare */
- if (l_len == 0 || s_len == 0)
- return (NULL);
-
- /* "s" must be smaller or equal to "l" */
- if (l_len < s_len)
- return (NULL);
-
- /* special case where s_len == 1 */
- if (s_len == 1)
- return (memchr(l, (int)*cs, l_len));
-
- /* the last position where its possible to find "s" in "l" */
- last = (char *)cl + l_len - s_len;
-
- for (cur = (char *)cl; cur <= last; cur++)
- if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0)
- return (cur);
-
- return (NULL);
-}