Index: uspace/lib/c/generic/task.c
===================================================================
--- uspace/lib/c/generic/task.c	(revision 71717609ad839bc0a9376e3b86af0681295db668)
+++ uspace/lib/c/generic/task.c	(revision a05f2af2f058ddcf89958654f2feb3db043e5a3d)
@@ -201,4 +201,40 @@
  *
  * This is really just a convenience wrapper over the more complicated
+ * loader API. Arguments are passed in a va_list.
+ *
+ * @param id   If not NULL, the ID of the task is stored here on success.
+ * @param path Pathname of the binary to execute.
+ * @param cnt  Number of arguments.
+ * @param ap   Command-line arguments.
+ *
+ * @return Zero on success or negative error code.
+ *
+ */
+int task_spawn(task_id_t *task_id, const char *path, int cnt, va_list ap)
+{
+	/* Allocate argument list. */
+	const char **arglist = malloc(cnt * sizeof(const char *));
+	if (arglist == NULL)
+		return ENOMEM;
+	
+	/* Fill in arguments. */
+	const char *arg;
+	cnt = 0;
+	do {
+		arg = va_arg(ap, const char *);
+		arglist[cnt++] = arg;
+	} while (arg != NULL);
+	
+	/* Spawn task. */
+	int rc = task_spawnv(task_id, path, arglist);
+	
+	/* Free argument list. */
+	free(arglist);
+	return rc;
+}
+
+/** Create a new task by running an executable from the filesystem.
+ *
+ * This is really just a convenience wrapper over the more complicated
  * loader API. Arguments are passed as a null-terminated list of arguments.
  *
@@ -216,5 +252,4 @@
 	va_list ap;
 	const char *arg;
-	const char **arglist;
 	int cnt = 0;
 	
@@ -226,23 +261,8 @@
 	va_end(ap);
 	
-	/* Allocate argument list. */
-	arglist = malloc(cnt * sizeof(const char *));
-	if (arglist == NULL)
-		return ENOMEM;
-	
-	/* Fill in arguments. */
-	cnt = 0;
 	va_start(ap, path);
-	do {
-		arg = va_arg(ap, const char *);
-		arglist[cnt++] = arg;
-	} while (arg != NULL);
+	int rc = task_spawn(task_id, path, cnt, ap);
 	va_end(ap);
 	
-	/* Spawn task. */
-	int rc = task_spawnv(task_id, path, arglist);
-	
-	/* Free argument list. */
-	free(arglist);
 	return rc;
 }
