diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2020-09-28 11:50:59 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2020-09-28 11:50:59 +0000 |
commit | 6f23a9bc76766dec0e7ede5387a6652eacb50164 (patch) | |
tree | 91d0f9fe38dd2488dd25322a6a467cb01a2d7367 /usr/src/lib/libc | |
parent | 483cfaba9947c7223e1971a45f9b473b324689d9 (diff) | |
parent | 28de4f3c3209c81f9a96e2019d44a0b9adcb74cb (diff) | |
download | illumos-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')
-rw-r--r-- | usr/src/lib/libc/amd64/Makefile | 4 | ||||
-rw-r--r-- | usr/src/lib/libc/i386/Makefile.com | 4 | ||||
-rw-r--r-- | usr/src/lib/libc/port/gen/explicit_bzero.c | 21 | ||||
-rw-r--r-- | usr/src/lib/libc/port/gen/memmem.c | 87 | ||||
-rw-r--r-- | usr/src/lib/libc/sparc/Makefile.com | 4 | ||||
-rw-r--r-- | usr/src/lib/libc/sparcv9/Makefile.com | 4 |
6 files changed, 8 insertions, 116 deletions
diff --git a/usr/src/lib/libc/amd64/Makefile b/usr/src/lib/libc/amd64/Makefile index a134e08c87..c1cfec6f49 100644 --- a/usr/src/lib/libc/amd64/Makefile +++ b/usr/src/lib/libc/amd64/Makefile @@ -103,6 +103,8 @@ COMOBJS= \ bcopy.o \ bsearch.o \ bzero.o \ + explicit_bzero.o \ + memmem.o \ qsort.o \ strtol.o \ strtoul.o \ @@ -388,7 +390,6 @@ PORTGEN= \ euclen.o \ event_port.o \ execvp.o \ - explicit_bzero.o \ fattach.o \ fdetach.o \ fdopendir.o \ @@ -467,7 +468,6 @@ PORTGEN= \ madvise.o \ malloc.o \ memalign.o \ - memmem.o \ memset_s.o \ mkdev.o \ mkdtemp.o \ diff --git a/usr/src/lib/libc/i386/Makefile.com b/usr/src/lib/libc/i386/Makefile.com index 13218d9980..0b26928f41 100644 --- a/usr/src/lib/libc/i386/Makefile.com +++ b/usr/src/lib/libc/i386/Makefile.com @@ -104,6 +104,8 @@ COMOBJS= \ bcopy.o \ bsearch.o \ bzero.o \ + explicit_bzero.o \ + memmem.o \ qsort.o \ strtol.o \ strtoul.o \ @@ -425,7 +427,6 @@ PORTGEN= \ euclen.o \ event_port.o \ execvp.o \ - explicit_bzero.o \ fattach.o \ fdetach.o \ fdopendir.o \ @@ -504,7 +505,6 @@ PORTGEN= \ madvise.o \ malloc.o \ memalign.o \ - memmem.o \ memset_s.o \ mkdev.o \ mkdtemp.o \ 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); -} diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com index 0d5febe066..8d30949022 100644 --- a/usr/src/lib/libc/sparc/Makefile.com +++ b/usr/src/lib/libc/sparc/Makefile.com @@ -127,7 +127,9 @@ COMOBJS= \ bcopy.o \ bzero.o \ bsearch.o \ + explicit_bzero.o \ memccpy.o \ + memmem.o \ qsort.o \ strtol.o \ strtoul.o \ @@ -451,7 +453,6 @@ PORTGEN= \ euclen.o \ event_port.o \ execvp.o \ - explicit_bzero.o \ fattach.o \ fdetach.o \ fdopendir.o \ @@ -531,7 +532,6 @@ PORTGEN= \ madvise.o \ malloc.o \ memalign.o \ - memmem.o \ memset_s.o \ mkdev.o \ mkdtemp.o \ diff --git a/usr/src/lib/libc/sparcv9/Makefile.com b/usr/src/lib/libc/sparcv9/Makefile.com index 0a826826ee..a0494d3cb5 100644 --- a/usr/src/lib/libc/sparcv9/Makefile.com +++ b/usr/src/lib/libc/sparcv9/Makefile.com @@ -130,7 +130,9 @@ COMOBJS= \ bcopy.o \ bsearch.o \ bzero.o \ + explicit_bzero.o \ memccpy.o \ + memmem.o \ qsort.o \ strtol.o \ strtoul.o \ @@ -409,7 +411,6 @@ PORTGEN= \ euclen.o \ event_port.o \ execvp.o \ - explicit_bzero.o \ fattach.o \ fdetach.o \ fdopendir.o \ @@ -489,7 +490,6 @@ PORTGEN= \ madvise.o \ malloc.o \ memalign.o \ - memmem.o \ memset_s.o \ mkdev.o \ mkdtemp.o \ |