Index: uspace/lib/posix/include/posix/string.h
===================================================================
--- uspace/lib/posix/include/posix/string.h	(revision 1c635d6076d5ecbddc9b9e9a97d69324a6d97b18)
+++ uspace/lib/posix/include/posix/string.h	(revision 12b29f32772d8b50ed4478da4ccb5adf9396f70e)
@@ -64,7 +64,4 @@
  * forward declarations ought to be enough.
  */
-/* From str.h. */
-extern char * strtok_r(char *, const char *, char **);
-extern char * strtok(char *, const char *);
 
 /* From mem.h */
@@ -101,4 +98,9 @@
 extern char *__POSIX_DEF__(strstr)(const char *haystack, const char *needle);
 
+/* Tokenization functions. */
+extern char *__POSIX_DEF__(strtok_r)(char *, const char *, char **);
+extern char *__POSIX_DEF__(strtok)(char *, const char *);
+
+
 /* Collation Functions */
 extern int __POSIX_DEF__(strcoll)(const char *s1, const char *s2);
Index: uspace/lib/posix/source/string.c
===================================================================
--- uspace/lib/posix/source/string.c	(revision 1c635d6076d5ecbddc9b9e9a97d69324a6d97b18)
+++ uspace/lib/posix/source/string.c	(revision 12b29f32772d8b50ed4478da4ccb5adf9396f70e)
@@ -508,4 +508,57 @@
 	
 	return NULL;
+}
+
+/** Split string by delimiters.
+ *
+ * @param s             String to be tokenized. May not be NULL.
+ * @param delim		String with the delimiters.
+ * @return              Pointer to the prefix of @a s before the first
+ *                      delimiter character. NULL if no such prefix
+ *                      exists.
+ */
+char *posix_strtok(char *s, const char *delim)
+{
+	static char *next;
+
+	return posix_strtok_r(s, delim, &next);
+}
+
+
+/** Split string by delimiters.
+ *
+ * @param s             String to be tokenized. May not be NULL.
+ * @param delim		String with the delimiters.
+ * @param next		Variable which will receive the pointer to the
+ *                      continuation of the string following the first
+ *                      occurrence of any of the delimiter characters.
+ *                      May be NULL.
+ * @return              Pointer to the prefix of @a s before the first
+ *                      delimiter character. NULL if no such prefix
+ *                      exists.
+ */
+char *posix_strtok_r(char *s, const char *delim, char **next)
+{
+	char *start, *end;
+
+	if (s == NULL)
+		s = *next;
+
+	/* Skip over leading delimiters. */
+	while (*s && (posix_strchr(delim, *s) != NULL)) ++s;
+	start = s;
+
+	/* Skip over token characters. */
+	while (*s && (posix_strchr(delim, *s) == NULL)) ++s;
+	end = s;
+	*next = (*s ? s + 1 : s);
+
+	if (start == end) {
+		return NULL;	/* No more tokens. */
+	}
+
+	/* Overwrite delimiter with NULL terminator. */
+	*end = '\0';
+	return start;
 }
 
