Index: uspace/lib/posix/string.c
===================================================================
--- uspace/lib/posix/string.c	(revision 65ed8f445abbe2feaa3660ae3d694123183ccc35)
+++ uspace/lib/posix/string.c	(revision 517cedc0f79788b977a0fad26e8758ecb7780abc)
@@ -44,19 +44,4 @@
 
 /**
- * Defined for convenience. Returns pointer to the terminating nul character.
- *
- * @param s
- * @return
- */
-static char *strzero(const char *s)
-{
-	while (*s != '\0') {
-		s++;
-	}
-
-	return (char *) s;
-}
-
-/**
  * Returns true if s2 is a prefix of s1.
  *
@@ -183,5 +168,5 @@
 	assert(src != NULL);
 
-	posix_strcpy(strzero(dest), src);
+	posix_strcpy(posix_strchr(dest, '\0'), src);
 	return dest;
 }
@@ -199,5 +184,5 @@
 	assert(src != NULL);
 
-	char *zeroptr = posix_strncpy(strzero(dest), src, n);
+	char *zeroptr = posix_strncpy(posix_strchr(dest, '\0'), src, n);
 	/* strncpy doesn't append the nul terminator, so we do it here */
 	zeroptr[n] = '\0';
@@ -360,19 +345,6 @@
 	assert(s != NULL);
 	
-	/* special handling for the case that zero is searched for */
-	if (c == '\0') {
-		return strzero(s);
-	}
-	
-	/* otherwise just loop through the string until found */
-	while (*s != (char) c) {
-		if (*s == '\0') {
-			return NULL;
-		}
-
-		s++;
-	}
-	
-	return (char *) s;
+	char *res = gnu_strchrnul(s, c);
+	return (*res == c) ? res : NULL;
 }
 
@@ -387,5 +359,5 @@
 	assert(s != NULL);
 	
-	const char *ptr = strzero(s);
+	const char *ptr = posix_strchr(s, '\0');
 	
 	/* the same as in strchr, except it loops in reverse direction */
@@ -399,4 +371,15 @@
 
 	return (char *) ptr;
+}
+
+char *gnu_strchrnul(const char *s, int c)
+{
+	assert(s != NULL);
+	
+	while (*s != c && *s != '\0') {
+		s++;
+	}
+	
+	return (char *) s;
 }
 
@@ -562,5 +545,5 @@
 	assert(s != NULL);
 	
-	return (size_t) (strzero(s) - s);
+	return (size_t) (posix_strchr(s, '\0') - s);
 }
 
Index: uspace/lib/posix/string.h
===================================================================
--- uspace/lib/posix/string.h	(revision 65ed8f445abbe2feaa3660ae3d694123183ccc35)
+++ uspace/lib/posix/string.h	(revision 517cedc0f79788b977a0fad26e8758ecb7780abc)
@@ -85,4 +85,5 @@
 extern char *posix_strchr(const char *s, int c);
 extern char *posix_strrchr(const char *s, int c);
+extern char *gnu_strchrnul(const char *s, int c);
 extern char *posix_strpbrk(const char *s1, const char *s2);
 extern size_t posix_strcspn(const char *s1, const char *s2);
@@ -127,4 +128,5 @@
 	#define strchr posix_strchr
 	#define strrchr posix_strrchr
+	#define strchrnul gnu_strchrnul
 	#define strpbrk posix_strpbrk
 	#define strcspn posix_strcspn
