diff options
author | Roger A. Faulkner <Roger.Faulkner@Oracle.COM> | 2010-08-12 14:55:22 -0700 |
---|---|---|
committer | Roger A. Faulkner <Roger.Faulkner@Oracle.COM> | 2010-08-12 14:55:22 -0700 |
commit | 23a1ccea6aac035f084a7a4cdc968687d1b02daf (patch) | |
tree | 6ed5e310ce6dd96f997b0c0f9735805d513d898a /usr/src/lib/nsswitch/files/common/gethostent.c | |
parent | 29c3196fe2acc65721d8b9b5ea708d3a87facde0 (diff) | |
download | illumos-gate-23a1ccea6aac035f084a7a4cdc968687d1b02daf.tar.gz |
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
Diffstat (limited to 'usr/src/lib/nsswitch/files/common/gethostent.c')
-rw-r--r-- | usr/src/lib/nsswitch/files/common/gethostent.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/usr/src/lib/nsswitch/files/common/gethostent.c b/usr/src/lib/nsswitch/files/common/gethostent.c index c2d9530a86..aa8e9da993 100644 --- a/usr/src/lib/nsswitch/files/common/gethostent.c +++ b/usr/src/lib/nsswitch/files/common/gethostent.c @@ -20,12 +20,9 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <netdb.h> #include "files_common.h" #include <string.h> @@ -42,7 +39,6 @@ static int check_name(nss_XbyY_args_t *, const char *, int, int, const char **, int *, void *, int *); static char *do_aliases(); -static char *strcasestr(const char *as1, const char *as2); nss_status_t __nss_files_XY_hostbyname(); int __nss_files_2herrno(); static int __nss_files_get_addr(int, const char *, int, @@ -680,37 +676,6 @@ __nss_files_XY_hostbyname(be, args, filter, type) return (res); } -/* - * A case-insensitive version of strstr(). - */ -static char * -strcasestr(const char *as1, const char *as2) -{ - int c2; - register const char *tptr; - register const char *s1, *s2; - - s1 = as1; - s2 = as2; - - if (s2 == NULL || *s2 == '\0') - return (0); - - while (*s1) { - if (tolower(*s1++) == tolower(c2 = *s2)) { - tptr = s1; - while ((tolower(c2 = *++s2) == - tolower(*s1++)) && c2 != 0) - ; - if (c2 == 0) - return ((char *)tptr - 1); - s1 = tptr; - s2 = as2; - } - } - return (0); -} - static char * do_aliases(struct hostent *hp, char *abuf, char *end) |