Index: uspace/lib/c/generic/str.c
===================================================================
--- uspace/lib/c/generic/str.c	(revision acf6b55769a37eb650905504688103655ff52925)
+++ uspace/lib/c/generic/str.c	(revision 48d9187cafdfe2d670bcf148be2f60d87fcdf264)
@@ -1689,4 +1689,49 @@
 }
 
+/** Convert string to int64_t.
+ *
+ * @param nptr   Pointer to string.
+ * @param endptr If not NULL, pointer to the first invalid character
+ *               is stored here.
+ * @param base   Zero or number between 2 and 36 inclusive.
+ * @param strict Do not allow any trailing characters.
+ * @param result Result of the conversion.
+ *
+ * @return EOK if conversion was successful.
+ *
+ */
+int str_int64_t(const char *nptr, const char **endptr, unsigned int base,
+    bool strict, int64_t *result)
+{
+	assert(result != NULL);
+
+	bool neg;
+	char *lendptr;
+	uint64_t unsigned_result;
+	int ret = str_uint(nptr, &lendptr, base, &neg, &unsigned_result);
+
+	if (endptr != NULL)
+		*endptr = (char *) lendptr;
+
+	if (ret != EOK)
+		return ret;
+
+	/* Do not allow negative values */
+	if (neg) {
+		if (unsigned_result == UINT64_MAX)
+			return EINVAL;
+
+		*result = -(int64_t)unsigned_result;
+	} else
+		*result = unsigned_result;
+
+	/* Check whether we are at the end of
+	   the string in strict mode */
+	if ((strict) && (*lendptr != 0))
+		return EINVAL;
+
+	return EOK;
+}
+
 /** Convert string to size_t.
  *
