#include "netlinkaccess.h"
-libc_hidden_proto(strndup)
libc_hidden_proto(strncpy)
libc_hidden_proto(strdup)
libc_hidden_proto(ioctl)
libc_hidden_proto(close)
+#if __ASSUME_NETLINK_SUPPORT
+libc_hidden_proto(strndup)
+#endif
extern int __opensock(void) attribute_hidden;
libc_hidden_proto(strcpy)
libc_hidden_proto(strlen)
libc_hidden_proto(strncmp)
-libc_hidden_proto(strnlen)
libc_hidden_proto(memmove)
libc_hidden_proto(getpid)
libc_hidden_proto(socket)
* and is useful in debugging the stdio code.
*/
-#define _ISOC99_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
# include <config.h>
#endif
-#define _XOPEN_SOURCE 500
#include <features.h>
#ifdef __UCLIBC__
#undef _LIBC
libc_hidden_proto(memcpy)
libc_hidden_proto(memset)
-libc_hidden_proto(stpcpy)
libc_hidden_proto(strtok_r)
libc_hidden_proto(strlen)
libc_hidden_proto(strcmp)
*/
static char hr_locale[(MAX_LOCALE_CATEGORY_STR * LC_ALL) + MAX_LOCALE_STR];
+libc_hidden_proto(stpcpy)
libc_hidden_proto(newlocale)
static void update_hr_locale(const unsigned char *spec)
/**********************************************************************/
#ifdef L_newlocale
+libc_hidden_proto(stpcpy)
libc_hidden_proto(newlocale)
#ifdef __UCLIBC_MJN3_ONLY__
{
if (BE (msg_size > errbuf_size, 0))
{
-#if defined HAVE_MEMPCPY || defined _LIBC
+#if (defined HAVE_MEMPCPY || defined _LIBC) && defined __USE_GNU
*((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
#else
memcpy (errbuf, msg, errbuf_size - 1);
#ifdef __UCLIBC__
#undef _LIBC
#define _REGEX_RE_COMP
-#define HAVE_MEMPCPY
+#ifdef __USE_GNU
+# define HAVE_MEMPCPY
+#endif
#define HAVE_LANGINFO
#define HAVE_LANGINFO_CODESET
#include <stdbool.h>
libc_hidden_proto(strncpy)
libc_hidden_proto(getenv)
libc_hidden_proto(strcasecmp)
-libc_hidden_proto(mempcpy)
libc_hidden_proto(abort)
+#ifdef __USE_GNU
+libc_hidden_proto(mempcpy)
+#endif
#endif
#ifdef __UCLIBC__
# undef _LIBC
# define _REGEX_RE_COMP
-# define HAVE_MEMPCPY
+# ifdef __USE_GNU
+# define HAVE_MEMPCPY
+# endif
# define STDC_HEADERS
# define RE_TRANSLATE_TYPE char *
#endif
libc_hidden_proto(strcmp)
libc_hidden_proto(strlen)
libc_hidden_proto(printf)
-libc_hidden_proto(mempcpy)
libc_hidden_proto(abort)
+#ifdef __USE_GNU
+libc_hidden_proto(mempcpy)
+#endif
/* AIX requires this to be the first thing in the file. */
#if defined _AIX && !defined REGEX_MALLOC
{
if (msg_size > errbuf_size)
{
-#if defined HAVE_MEMPCPY || defined _LIBC
+#if (defined HAVE_MEMPCPY || defined _LIBC) && defined __USE_GNU
*((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
#else
memcpy (errbuf, msg, errbuf_size - 1);
if (BE (s == NULL, 0))
return -2;
-#if defined _LIBC || defined __UCLIBC__
+#if (defined _LIBC || defined __UCLIBC__) && defined __USE_GNU
memcpy (__mempcpy (s, string1, length1), string2, length2);
#else
memcpy (s, string1, length1);
libc_hidden_proto(strcpy)
libc_hidden_proto(strlen)
libc_hidden_proto(strncpy)
-libc_hidden_proto(strnlen)
/* libc_hidden_proto(sprintf) */
libc_hidden_proto(open)
libc_hidden_proto(read)
#ifdef __UCLIBC_HAS_TM_EXTENSIONS__
+libc_hidden_proto(strnlen)
+
struct ll_tzname_item;
typedef struct ll_tzname_item {
* Manuel
*/
-#define _ISOC99_SOURCE
#include <errno.h>
#include <stddef.h>
#include <limits.h>
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define _ISOC99_SOURCE
#include <stdio.h>
#include <errno.h>
#include <paths.h>
#include "_string.h"
+#ifdef __USE_GNU
libc_hidden_proto(basename)
char *basename(const char *path)
return (char *) p;
}
libc_hidden_def(basename)
+#endif
#include <string.h>
#include <stddef.h>
+#ifdef __USE_GNU
libc_hidden_proto(memmem)
libc_hidden_proto(memcmp)
return NULL;
}
libc_hidden_def(memmem)
+#endif
#include <string.h>
+#ifdef __USE_GNU
libc_hidden_proto(mempcpy)
libc_hidden_proto(memcpy)
return (void *)(((char *)dstpp) + len);
}
libc_hidden_def(mempcpy)
+#endif
#include <stdlib.h>
#include <limits.h>
+#ifdef __USE_GNU
libc_hidden_proto(memrchr)
libc_hidden_proto(abort)
return 0;
}
libc_hidden_def(memrchr)
+#endif
#include <stdlib.h>
#include <limits.h>
+#ifdef __USE_GNU
libc_hidden_proto(rawmemchr)
libc_hidden_proto(abort)
}
}
libc_hidden_def(rawmemchr)
+#endif
#include <string.h>
#include <stdlib.h>
+#ifdef __USE_GNU
libc_hidden_proto(strchrnul)
libc_hidden_proto(abort)
return NULL;
}
libc_hidden_def(strchrnul)
+#endif
#include <string.h>
#include <stdlib.h>
+#ifdef __USE_GNU
libc_hidden_proto(strnlen)
libc_hidden_proto(abort)
return char_ptr - str;
}
libc_hidden_def(strnlen)
+#endif
libc_hidden_proto(strtok_r)
libc_hidden_proto(strspn)
libc_hidden_proto(strpbrk)
+#ifdef __USE_GNU
+# define __rawmemchr rawmemchr
libc_hidden_proto(rawmemchr)
+#else
+# define __rawmemchr strchr
+libc_hidden_proto(strchr)
+#endif
/* Parse S into tokens separated by characters in DELIM.
If S is NULL, the saved pointer in SAVE_PTR is used as
s = strpbrk (token, delim);
if (s == NULL)
/* This token finishes the string. */
- *save_ptr = rawmemchr (token, '\0');
+ *save_ptr = __rawmemchr (token, '\0');
else
{
/* Terminate the token and make *SAVE_PTR point past it. */
#include <string.h>
+#ifdef __USE_GNU
libc_hidden_proto(strnlen)
size_t strnlen(const char *s, size_t count)
{
return __res;
}
libc_hidden_def(strnlen)
+#endif
#include "_string.h"
+#ifdef __USE_GNU
+libc_hidden_proto(memmem)
void *memmem(const void *haystack, size_t haystacklen,
const void *needle, size_t needlelen)
{
return NULL;
}
+libc_hidden_def(memmem)
+#endif
#include "_string.h"
+#ifdef __USE_GNU
+
#ifdef WANT_WIDE
# define Wmempcpy wmempcpy
#else
}
libc_hidden_def(Wmempcpy)
+#endif
#include "_string.h"
+#ifdef __USE_GNU
+
libc_hidden_proto(memrchr)
void *memrchr(const void *s, int c, size_t n)
#undef np
libc_hidden_def(memrchr)
+#endif
#include "_string.h"
+#ifdef __USE_GNU
libc_hidden_proto(rawmemchr)
-
void *rawmemchr(const void *s, int c)
{
register const unsigned char *r = s;
return (void *) r; /* silence the warning */
}
libc_hidden_def(rawmemchr)
+#endif
#include "_string.h"
+#ifdef __USE_GNU
+
#ifdef WANT_WIDE
# define Wstrchrnul wcschrnul
#else
return (Wchar *) s;
}
libc_hidden_def(Wstrchrnul)
+#endif
#include "_string.h"
+#ifdef __USE_GNU
+
#ifdef WANT_WIDE
# define Wstrnlen wcsnlen
#else
#undef maxp
libc_hidden_def(Wstrnlen)
+#endif
#include <sys/types.h>
#include <sys/syscall.h>
-#if defined __NR_setresgid || defined __NR_setresgid32
+#if (defined __NR_setresgid || defined __NR_setresgid32) && defined __USE_GNU
libc_hidden_proto(setresgid)
#endif
libc_hidden_proto(setregid)
return -1;
}
-#if defined __NR_setresgid || defined __NR_setresgid32
+#if (defined __NR_setresgid || defined __NR_setresgid32) && defined __USE_GNU
result = setresgid(-1, gid, -1);
if (result == -1 && errno == ENOSYS)
/* Will also set the saved group ID if egid != gid,
libc_hidden_proto(seteuid)
-#if defined __NR_setresuid || defined __NR_setresuid32
+#if (defined __NR_setresuid || defined __NR_setresuid32) && defined __USE_GNU
libc_hidden_proto(setresuid)
#endif
libc_hidden_proto(setreuid)
return -1;
}
-#if defined __NR_setresuid || defined __NR_setresuid32
+#if (defined __NR_setresuid || defined __NR_setresuid32) && defined __USE_GNU
result = setresuid(-1, uid, -1);
if (result == -1 && errno == ENOSYS)
/* Will also set the saved user ID if euid != uid,
libc_hidden_proto(memcpy)
libc_hidden_proto(strchr)
libc_hidden_proto(strlen)
-libc_hidden_proto(strchrnul)
libc_hidden_proto(execve)
libc_hidden_proto(mmap)
libc_hidden_proto(munmap)
/**********************************************************************/
#ifdef L_execvp
+libc_hidden_proto(strchrnul)
+
/* Use a default path that matches glibc behavior, since SUSv3 says
* this is implementation-defined. The default is current working dir,
* /bin, and then /usr/bin. */