From 23a1ccea6aac035f084a7a4cdc968687d1b02daf Mon Sep 17 00:00:00 2001 From: "Roger A. Faulkner" Date: Thu, 12 Aug 2010 14:55:22 -0700 Subject: PSARC 2010/299 GNU/Linux/BSD compatibility functions 6960818 add get_nprocs(), getline(), strdupa(), strndup() to libc 6901783 strndup would be nice 6824404 libc should provide ffsl() & ffsll() 6793969 RFE: Add|stpcpy|to libc 6735446 Want a __progname symbol for BSD-style source compatibility 6421095 Solaris should provide strcasestr 6275498 Provide string compare functions wcscasecmp,wcsncasecmp in solaris like linux --HG-- rename : usr/src/lib/libc/port/gen/strcasecmp.c => usr/src/lib/libc/port/gen/ascii_strcasecmp.c rename : usr/src/lib/libc/port/gen/strncasecmp.c => usr/src/lib/libc/port/gen/ascii_strncasecmp.c rename : usr/src/lib/libc/sparc/gen/strcasecmp.s => usr/src/lib/libc/sparc/gen/ascii_strcasecmp.s rename : usr/src/lib/libc/sparcv9/gen/strcasecmp.s => usr/src/lib/libc/sparcv9/gen/ascii_strcasecmp.s --- usr/src/lib/libcpc/i386/event_pentium.c | 20 +++++++++----------- usr/src/lib/libcpc/sparc/event_ultra.c | 14 +++++--------- 2 files changed, 14 insertions(+), 20 deletions(-) (limited to 'usr/src/lib/libcpc') diff --git a/usr/src/lib/libcpc/i386/event_pentium.c b/usr/src/lib/libcpc/i386/event_pentium.c index 423de87694..3619bc4036 100644 --- a/usr/src/lib/libcpc/i386/event_pentium.c +++ b/usr/src/lib/libcpc/i386/event_pentium.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * 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. @@ -19,13 +18,11 @@ * * CDDL HEADER END */ + /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Routines to capture processor-dependencies in event specification. */ @@ -33,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -407,7 +403,7 @@ cpc_strtoevent(int cpuver, const char *spec, cpc_event_t *event) pic[0] = pic[1] = NULL; - opts = strcpy(alloca(strlen(spec) + 1), spec); + opts = strdupa(spec); while (*opts != '\0') { const struct keyval *kv; int idx = getsubopt(&opts, tokens, &value); @@ -629,7 +625,8 @@ cpc_eventtostr(cpc_event_t *event) xpes[0].inv, xpes[1].inv, 0, tokens[D_inv]); flagstostr(buffer, xpes[0].pc, xpes[1].pc, 0, tokens[D_pc]); - } break; + break; + } case CPC_PENTIUM_MMX: case CPC_PENTIUM: { @@ -654,7 +651,8 @@ cpc_eventtostr(cpc_event_t *event) xcesr.clk[0], xcesr.clk[1], 0, tokens[D_noedge]); flagstostr(buffer, xcesr.pc[0], xcesr.pc[1], 0, tokens[D_pc]); - } break; + break; + } default: return (NULL); } diff --git a/usr/src/lib/libcpc/sparc/event_ultra.c b/usr/src/lib/libcpc/sparc/event_ultra.c index c99e706bb2..a0e895ebea 100644 --- a/usr/src/lib/libcpc/sparc/event_ultra.c +++ b/usr/src/lib/libcpc/sparc/event_ultra.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * 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. @@ -19,13 +18,11 @@ * * CDDL HEADER END */ + /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Routines to capture processor-dependencies in event specification. */ @@ -33,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -243,7 +239,7 @@ cpc_strtoevent(int cpuver, const char *spec, cpc_event_t *event) pic[0] = pic[1] = NULL; - opts = strcpy(alloca(strlen(spec) + 1), spec); + opts = strdupa(spec); while (*opts != '\0') { const struct keyval *kv; int idx = getsubopt(&opts, tokens, &value); -- cgit v1.2.3