4 #include_next <string.h>
6 /* map the internal glibc interface to the public one */
7 #define __memcpy(to, from, size) memcpy(to, from, size)
8 #define __strchrnul(string, character) strchrnul(string, character)
9 #define __strnlen strnlen
10 #define __strdup strdup
11 #define __strndup strndup
12 #define __stpcpy stpcpy
13 #define __strtok_r strtok_r
14 #define __strcasecmp strcasecmp
17 __strerror_r(int error
, char *buffer
, size_t bufferSize
)
19 if (strerror_r(error
, buffer
, bufferSize
) != 0)
20 strlcpy(buffer
, "Unknown Error", bufferSize
);
26 __mempcpy(void *to
, const void *from
, size_t size
)
28 memcpy(to
, from
, size
);
29 return (unsigned char *)to
+ size
;
36 __const char *__old = (s); \
37 size_t __len = strlen (__old) + 1; \
38 char *__new = (char *) __builtin_alloca (__len); \
39 (char *) memcpy (__new, __old, __len); \
42 /* Alternative version which doesn't pollute glibc's namespace. */
44 #define strndupa(s, n) \
47 __const char *__old = (s); \
48 size_t __len = __strnlen (__old, (n)); \
49 char *__new = (char *) __builtin_alloca (__len + 1); \
50 __new[__len] = '\0'; \
51 (char *) memcpy (__new, __old, __len); \
54 #endif /* _LIBC_STRING_H */