Index: uspace/lib/c/generic/loc.c
===================================================================
--- uspace/lib/c/generic/loc.c	(revision 16dc8870242df10ae64ee7bcbf125aa8607cb7fb)
+++ uspace/lib/c/generic/loc.c	(revision 6d605e69652806366168cf5466d2498cf2f28dbf)
@@ -589,12 +589,11 @@
 }
 
-static int loc_category_get_svcs_internal(category_id_t cat_id,
-    service_id_t *id_buf, size_t buf_size, size_t *act_size)
+static int loc_category_get_ids_once(sysarg_t method, sysarg_t arg1,
+    sysarg_t *id_buf, size_t buf_size, size_t *act_size)
 {
 	async_exch_t *exch = loc_exchange_begin_blocking(LOC_PORT_CONSUMER);
 
 	ipc_call_t answer;
-	aid_t req = async_send_1(exch, LOC_CATEGORY_GET_SVCS, cat_id,
-	    &answer);
+	aid_t req = async_send_1(exch, method, arg1, &answer);
 	int rc = async_data_read_start(exch, id_buf, buf_size);
 	
@@ -614,4 +613,57 @@
 	
 	*act_size = IPC_GET_ARG1(answer);
+	return EOK;
+}
+
+/** Get list of IDs.
+ *
+ * Returns an allocated array of service IDs.
+ *
+ * @param method	IPC method
+ * @param arg1		IPC argument 1
+ * @param data		Place to store pointer to array of IDs
+ * @param count		Place to store number of IDs
+ * @return 		EOK on success or negative error code
+ */
+static int loc_get_ids_internal(sysarg_t method, sysarg_t arg1,
+    sysarg_t **data, size_t *count)
+{
+	service_id_t *ids;
+	size_t act_size;
+	size_t alloc_size;
+	int rc;
+
+	*data = NULL;
+	act_size = 0;	/* silence warning */
+
+	rc = loc_category_get_ids_once(method, arg1, NULL, 0,
+	    &act_size);
+	if (rc != EOK)
+		return rc;
+
+	alloc_size = act_size;
+	ids = malloc(alloc_size);
+	if (ids == NULL)
+		return ENOMEM;
+
+	while (true) {
+		rc = loc_category_get_ids_once(method, arg1, ids, alloc_size,
+		    &act_size);
+		if (rc != EOK)
+			return rc;
+
+		if (act_size <= alloc_size)
+			break;
+
+		alloc_size *= 2;
+		free(ids);
+
+		ids = malloc(alloc_size);
+		if (ids == NULL)
+			return ENOMEM;
+	}
+
+	*count = act_size / sizeof(category_id_t);
+	*data = ids;
 	return EOK;
 }
@@ -626,43 +678,22 @@
  * @return 		EOK on success or negative error code
  */
-int loc_category_get_svcs(category_id_t cat_id, category_id_t **data,
+int loc_category_get_svcs(category_id_t cat_id, service_id_t **data,
     size_t *count)
 {
-	service_id_t *ids;
-	size_t act_size;
-	size_t alloc_size;
-	int rc;
-
-	*data = NULL;
-	act_size = 0;	/* silence warning */
-
-	rc = loc_category_get_svcs_internal(cat_id, NULL, 0, &act_size);
-	if (rc != EOK)
-		return rc;
-
-	alloc_size = act_size;
-	ids = malloc(alloc_size);
-	if (ids == NULL)
-		return ENOMEM;
-
-	while (true) {
-		rc = loc_category_get_svcs_internal(cat_id, ids, alloc_size,
-		    &act_size);
-		if (rc != EOK)
-			return rc;
-
-		if (act_size <= alloc_size)
-			break;
-
-		alloc_size *= 2;
-		free(ids);
-
-		ids = malloc(alloc_size);
-		if (ids == NULL)
-			return ENOMEM;
-	}
-
-	*count = act_size / sizeof(category_id_t);
-	*data = ids;
-	return EOK;
-}
+	return loc_get_ids_internal(LOC_CATEGORY_GET_SVCS, cat_id,
+	    data, count);
+}
+
+/** Get list of categories.
+ *
+ * Returns an allocated array of category IDs.
+ *
+ * @param data		Place to store pointer to array of IDs
+ * @param count		Place to store number of IDs
+ * @return 		EOK on success or negative error code
+ */
+int loc_get_categories(category_id_t **data, size_t *count)
+{
+	return loc_get_ids_internal(LOC_GET_CATEGORIES, 0,
+	    data, count);
+}
Index: uspace/lib/c/include/ipc/loc.h
===================================================================
--- uspace/lib/c/include/ipc/loc.h	(revision 16dc8870242df10ae64ee7bcbf125aa8607cb7fb)
+++ uspace/lib/c/include/ipc/loc.h	(revision 6d605e69652806366168cf5466d2498cf2f28dbf)
@@ -63,4 +63,5 @@
 	LOC_GET_NAMESPACE_COUNT,
 	LOC_GET_SERVICE_COUNT,
+	LOC_GET_CATEGORIES,
 	LOC_GET_NAMESPACES,
 	LOC_GET_SERVICES
Index: uspace/lib/c/include/loc.h
===================================================================
--- uspace/lib/c/include/loc.h	(revision 16dc8870242df10ae64ee7bcbf125aa8607cb7fb)
+++ uspace/lib/c/include/loc.h	(revision 6d605e69652806366168cf5466d2498cf2f28dbf)
@@ -70,4 +70,6 @@
 extern size_t loc_get_namespaces(loc_sdesc_t **);
 extern size_t loc_get_services(service_id_t, loc_sdesc_t **);
+extern int loc_get_categories(category_id_t **, size_t *);
+
 
 #endif
