Index: uspace/lib/posix/src/string.c
===================================================================
--- uspace/lib/posix/src/string.c	(revision df2e5514fa8f0044ee3ce752a6fd5cf72425718e)
+++ uspace/lib/posix/src/string.c	(revision 55958412df6b000da41325bf219018aabc44bde9)
@@ -34,7 +34,4 @@
  */
 
-#define LIBPOSIX_INTERNAL
-#define __POSIX_DEF__(x) posix_##x
-
 #include "internal/common.h"
 #include "posix/string.h"
@@ -62,5 +59,5 @@
 static char *strpbrk_null(const char *s1, const char *s2)
 {
-	while (!posix_strchr(s2, *s1)) {
+	while (!strchr(s2, *s1)) {
 		++s1;
 	}
@@ -76,7 +73,7 @@
  * @return Pointer to the destination buffer.
  */
-char *posix_strcpy(char *restrict dest, const char *restrict src)
-{
-	posix_stpcpy(dest, src);
+char *strcpy(char *restrict dest, const char *restrict src)
+{
+	stpcpy(dest, src);
 	return dest;
 }
@@ -90,7 +87,7 @@
  * @return Pointer to the destination buffer.
  */
-char *posix_strncpy(char *restrict dest, const char *restrict src, size_t n)
-{
-	posix_stpncpy(dest, src, n);
+char *strncpy(char *restrict dest, const char *restrict src, size_t n)
+{
+	stpncpy(dest, src, n);
 	return dest;
 }
@@ -103,5 +100,5 @@
  * @return Pointer to the nul character in the destination string.
  */
-char *posix_stpcpy(char *restrict dest, const char *restrict src)
+char *stpcpy(char *restrict dest, const char *restrict src)
 {
 	assert(dest != NULL);
@@ -129,5 +126,5 @@
  * @return Pointer to the first written nul character or &dest[n].
  */
-char *posix_stpncpy(char *restrict dest, const char *restrict src, size_t n)
+char *stpncpy(char *restrict dest, const char *restrict src, size_t n)
 {
 	assert(dest != NULL);
@@ -159,10 +156,10 @@
  * @return Pointer to destination buffer.
  */
-char *posix_strcat(char *restrict dest, const char *restrict src)
+char *strcat(char *restrict dest, const char *restrict src)
 {
 	assert(dest != NULL);
 	assert(src != NULL);
 
-	posix_strcpy(posix_strchr(dest, '\0'), src);
+	strcpy(strchr(dest, '\0'), src);
 	return dest;
 }
@@ -176,10 +173,10 @@
  * @return Pointer to destination buffer.
  */
-char *posix_strncat(char *restrict dest, const char *restrict src, size_t n)
+char *strncat(char *restrict dest, const char *restrict src, size_t n)
 {
 	assert(dest != NULL);
 	assert(src != NULL);
 
-	char *zeroptr = posix_strncpy(posix_strchr(dest, '\0'), src, n);
+	char *zeroptr = strncpy(strchr(dest, '\0'), src, n);
 	/* strncpy doesn't append the nul terminator, so we do it here */
 	zeroptr[n] = '\0';
@@ -196,5 +193,5 @@
  * @return Pointer to the first byte after c in dest if found, NULL otherwise.
  */
-void *posix_memccpy(void *restrict dest, const void *restrict src, int c, size_t n)
+void *memccpy(void *restrict dest, const void *restrict src, int c, size_t n)
 {
 	assert(dest != NULL);
@@ -222,7 +219,7 @@
  * @return Newly allocated copy of the string.
  */
-char *posix_strdup(const char *s)
-{
-	return posix_strndup(s, SIZE_MAX);
+char *strdup(const char *s)
+{
+	return strndup(s, SIZE_MAX);
 }
 
@@ -234,9 +231,9 @@
  * @return Newly allocated string copy of length at most n.
  */
-char *posix_strndup(const char *s, size_t n)
+char *strndup(const char *s, size_t n)
 {
 	assert(s != NULL);
 
-	size_t len = posix_strnlen(s, n);
+	size_t len = strnlen(s, n);
 	char *dup = malloc(len + 1);
 	if (dup == NULL) {
@@ -248,30 +245,4 @@
 
 	return dup;
-}
-
-/**
- * Compare bytes in memory.
- *
- * @param mem1 First area of memory to be compared.
- * @param mem2 Second area of memory to be compared.
- * @param n Maximum number of bytes to be compared.
- * @return Difference of the first pair of inequal bytes,
- *     or 0 if areas have the same content.
- */
-int posix_memcmp(const void *mem1, const void *mem2, size_t n)
-{
-	assert(mem1 != NULL);
-	assert(mem2 != NULL);
-
-	const unsigned char *s1 = mem1;
-	const unsigned char *s2 = mem2;
-	
-	for (size_t i = 0; i < n; ++i) {
-		if (s1[i] != s2[i]) {
-			return s1[i] - s2[i];
-		}
-	}
-	
-	return 0;
 }
 
@@ -284,10 +255,10 @@
  *     or 0 if strings have the same content.
  */
-int posix_strcmp(const char *s1, const char *s2)
+int strcmp(const char *s1, const char *s2)
 {
 	assert(s1 != NULL);
 	assert(s2 != NULL);
 
-	return posix_strncmp(s1, s2, STR_NO_LIMIT);
+	return strncmp(s1, s2, STR_NO_LIMIT);
 }
 
@@ -301,5 +272,5 @@
  *     or 0 if strings have the same content.
  */
-int posix_strncmp(const char *s1, const char *s2, size_t n)
+int strncmp(const char *s1, const char *s2, size_t n)
 {
 	assert(s1 != NULL);
@@ -327,5 +298,5 @@
  *     NULL pointer otherwise.
  */
-void *posix_memchr(const void *mem, int c, size_t n)
+void *memchr(const void *mem, int c, size_t n)
 {
 	assert(mem != NULL);
@@ -349,5 +320,5 @@
  *     NULL pointer otherwise.
  */
-char *posix_strchr(const char *s, int c)
+char *strchr(const char *s, int c)
 {
 	assert(s != NULL);
@@ -365,9 +336,9 @@
  *     NULL pointer otherwise.
  */
-char *posix_strrchr(const char *s, int c)
+char *strrchr(const char *s, int c)
 {
 	assert(s != NULL);
 	
-	const char *ptr = posix_strchr(s, '\0');
+	const char *ptr = strchr(s, '\0');
 	
 	/* the same as in strchr, except it loops in reverse direction */
@@ -410,5 +381,5 @@
  *     NULL pointer otherwise.
  */
-char *posix_strpbrk(const char *s1, const char *s2)
+char *strpbrk(const char *s1, const char *s2)
 {
 	assert(s1 != NULL);
@@ -426,5 +397,5 @@
  * @return Length of the prefix.
  */
-size_t posix_strcspn(const char *s1, const char *s2)
+size_t strcspn(const char *s1, const char *s2)
 {
 	assert(s1 != NULL);
@@ -442,5 +413,5 @@
  * @return Length of the prefix.
  */
-size_t posix_strspn(const char *s1, const char *s2)
+size_t strspn(const char *s1, const char *s2)
 {
 	assert(s1 != NULL);
@@ -449,5 +420,5 @@
 	const char *ptr;
 	for (ptr = s1; *ptr != '\0'; ++ptr) {
-		if (!posix_strchr(s2, *ptr)) {
+		if (!strchr(s2, *ptr)) {
 			break;
 		}
@@ -464,5 +435,5 @@
  *     not found.
  */
-char *posix_strstr(const char *haystack, const char *needle)
+char *strstr(const char *haystack, const char *needle)
 {
 	assert(haystack != NULL);
@@ -475,5 +446,5 @@
 	
 	/* Preprocess needle. */
-	size_t nlen = posix_strlen(needle);
+	size_t nlen = strlen(needle);
 	size_t prefix_table[nlen + 1];
 	
@@ -521,9 +492,9 @@
  *                      exists.
  */
-char *posix_strtok(char *s, const char *delim)
+char *strtok(char *s, const char *delim)
 {
 	static char *next;
 
-	return posix_strtok_r(s, delim, &next);
+	return strtok_r(s, delim, &next);
 }
 
@@ -541,5 +512,5 @@
  *                      exists.
  */
-char *posix_strtok_r(char *s, const char *delim, char **next)
+char *strtok_r(char *s, const char *delim, char **next)
 {
 	char *start, *end;
@@ -549,9 +520,9 @@
 
 	/* Skip over leading delimiters. */
-	while (*s && (posix_strchr(delim, *s) != NULL)) ++s;
+	while (*s && (strchr(delim, *s) != NULL)) ++s;
 	start = s;
 
 	/* Skip over token characters. */
-	while (*s && (posix_strchr(delim, *s) == NULL)) ++s;
+	while (*s && (strchr(delim, *s) == NULL)) ++s;
 	end = s;
 	*next = (*s ? s + 1 : s);
@@ -576,10 +547,10 @@
  *     or 0 if strings have the same content.
  */
-int posix_strcoll(const char *s1, const char *s2)
+int strcoll(const char *s1, const char *s2)
 {
 	assert(s1 != NULL);
 	assert(s2 != NULL);
 
-	return posix_strcmp(s1, s2);
+	return strcmp(s1, s2);
 }
 
@@ -596,13 +567,13 @@
  * @return Length of the transformed string.
  */
-size_t posix_strxfrm(char *restrict s1, const char *restrict s2, size_t n)
+size_t strxfrm(char *restrict s1, const char *restrict s2, size_t n)
 {
 	assert(s1 != NULL || n == 0);
 	assert(s2 != NULL);
 
-	size_t len = posix_strlen(s2);
+	size_t len = strlen(s2);
 
 	if (n > len) {
-		posix_strcpy(s1, s2);
+		strcpy(s1, s2);
 	}
 
@@ -616,5 +587,5 @@
  * @return Error message.
  */
-char *posix_strerror(int errnum)
+char *strerror(int errnum)
 {
 	// FIXME: move strerror() and strerror_r() to libc.
@@ -630,14 +601,14 @@
  * @return Zero on success, errno otherwise.
  */
-int posix_strerror_r(int errnum, char *buf, size_t bufsz)
+int strerror_r(int errnum, char *buf, size_t bufsz)
 {
 	assert(buf != NULL);
 	
-	char *errstr = posix_strerror(errnum);
-	
-	if (posix_strlen(errstr) + 1 > bufsz) {
+	char *errstr = strerror(errnum);
+	
+	if (strlen(errstr) + 1 > bufsz) {
 		return ERANGE;
 	} else {
-		posix_strcpy(buf, errstr);
+		strcpy(buf, errstr);
 	}
 
@@ -651,9 +622,9 @@
  * @return Length of the string.
  */
-size_t posix_strlen(const char *s)
+size_t strlen(const char *s)
 {
 	assert(s != NULL);
 	
-	return (size_t) (posix_strchr(s, '\0') - s);
+	return (size_t) (strchr(s, '\0') - s);
 }
 
@@ -665,5 +636,5 @@
  * @return The lower of either string length or n limit.
  */
-size_t posix_strnlen(const char *s, size_t n)
+size_t strnlen(const char *s, size_t n)
 {
 	assert(s != NULL);
@@ -685,5 +656,5 @@
  * @return Human readable signal description.
  */
-char *posix_strsignal(int signum)
+char *strsignal(int signum)
 {
 	static const char *const sigstrings[] = {
