Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision d9fae23532028671526d24c90116318f54d92d29)
+++ uspace/lib/c/Makefile	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
@@ -95,5 +95,10 @@
 	generic/vfs/canonify.c \
 	generic/stacktrace.c \
-	generic/arg_parse.c
+	generic/arg_parse.c \
+	generic/ps.c \
+	generic/cpuinfo.c \
+	generic/meminfo.c \
+	generic/load.c \
+	generic/uptime.c
 
 SOURCES = \
Index: uspace/lib/c/generic/cpuinfo.c
===================================================================
--- uspace/lib/c/generic/cpuinfo.c	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
+++ uspace/lib/c/generic/cpuinfo.c	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2010 Stanislav Kozina
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#include <libc.h>
+#include <ps.h>
+
+/** Get infos about system CPUs.
+ *
+ * @param cpus		Pointer where info structures will be stored.
+ * 			Use \ref sysinfo() to get cpu.count value.
+ *
+ * @return		EOK.
+ *
+ */
+int get_cpu_info(uspace_cpu_info_t *cpus)
+{
+	return __SYSCALL1(SYS_PS_GET_CPU_INFO, (sysarg_t) cpus);
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/load.c
===================================================================
--- uspace/lib/c/generic/load.c	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
+++ uspace/lib/c/generic/load.c	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2010 Stanislav Kozina
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#include <load.h>
+#include <libc.h>
+#include <stdio.h>
+
+/** Get current system load
+ *
+ * @param load		Pointer where load will be stored.
+ *
+ * @return		EOK.
+ *
+ */
+int get_load(unsigned long *load)
+{
+	return __SYSCALL1(SYS_PS_GET_LOAD, (sysarg_t) load);
+}
+
+void print_load_fragment(unsigned long upper, int dec_length)
+{
+	int i;
+	/* Magic value from BSD */
+	unsigned long lower = 65536;
+	/* Print whole part */
+	printf("%u.", upper / lower);
+	unsigned long rest = (upper % lower) * 10;
+	for (i = 0; i < dec_length; ++i) {
+		printf("%d", rest / lower);
+		rest = (rest % lower) * 10;
+	}
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/meminfo.c
===================================================================
--- uspace/lib/c/generic/meminfo.c	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
+++ uspace/lib/c/generic/meminfo.c	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2010 Stanislav Kozina
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#include <libc.h>
+#include <ps.h>
+
+/** Get infos about system memory.
+ *
+ * @param cpus		Pointer where info structures will be stored.
+ *
+ * @return		EOK.
+ *
+ */
+int get_mem_info(uspace_mem_info_t *meminfo)
+{
+	return __SYSCALL1(SYS_PS_GET_MEM_INFO, (sysarg_t) meminfo);
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/ps.c
===================================================================
--- uspace/lib/c/generic/ps.c	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
+++ uspace/lib/c/generic/ps.c	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2010 Stanislav Kozina
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#include <task.h>
+#include <thread.h>
+#include <ps.h>
+#include <libc.h>
+
+/** Get the list of task ids.
+ *
+ * @param ids		Pointer to space where list of ids will be stored.
+ * @param size		Total size of allocated space under ids.
+ *
+ * @return		Count of written task ids. If higher than size, there
+ * 			was not enough space.
+ *
+ */
+size_t get_task_ids(task_id_t *ids, size_t size)
+{
+	return __SYSCALL2(SYS_PS_GET_TASKS, (sysarg_t) ids, (sysarg_t) size);
+}
+
+/** Get task info.
+ *
+ * @param id		Id of the task to get info about.
+ * @param info		Pointer to out info struct.
+ *
+ * @return		0 on success.
+ *
+ */
+int get_task_info(task_id_t id, task_info_t *info)
+{
+	return __SYSCALL2(SYS_PS_GET_TASK_INFO, (sysarg_t) &id, (sysarg_t) info);
+}
+
+/** Get thread infos of the selected task.
+ *
+ * @param taskid 	Id of the selected task.
+ * @param infos		Pointer to out array of thread_info_t structures.
+ * @param size		Size of the infos array.
+ *
+ * @return		Count of written thread_infos. If higher than size, there
+ * 			was not enough space.
+ *
+ */
+size_t get_task_threads(thread_info_t *infos, size_t size)
+{
+	return __SYSCALL2(SYS_PS_GET_THREADS, (sysarg_t) infos, (sysarg_t) size);
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/uptime.c
===================================================================
--- uspace/lib/c/generic/uptime.c	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
+++ uspace/lib/c/generic/uptime.c	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2010 Stanislav Kozina
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#include <libc.h>
+#include <uptime.h>
+
+/** Get current system uptime
+ *
+ * @param load		Pointer where uptime will be stored.
+ *
+ * @return		EOK.
+ *
+ */
+int get_uptime(uint64_t *uptime)
+{
+	return __SYSCALL1(SYS_PS_GET_UPTIME, (sysarg_t) uptime);
+}
+
+/** @}
+ */
Index: uspace/lib/c/include/load.h
===================================================================
--- uspace/lib/c/include/load.h	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
+++ uspace/lib/c/include/load.h	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2010 Stanislav Kozina
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */ 
+
+#ifndef LIBC_LOAD_H_
+#define LIBC_LOAD_H_
+
+#include <sys/types.h>
+#include <libarch/types.h>
+
+extern int get_load(unsigned long *load);
+extern void print_load_fragment(unsigned long upper, int dec_length);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/ps.h
===================================================================
--- uspace/lib/c/include/ps.h	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
+++ uspace/lib/c/include/ps.h	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2010 Stanislav Kozina
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */ 
+
+#ifndef LIBC_PS_H_
+#define LIBC_PS_H_
+
+#include <task.h>
+#include <kernel/ps/taskinfo.h>
+#include <kernel/ps/cpuinfo.h>
+#include <kernel/ps/meminfo.h>
+
+extern int get_cpu_info(uspace_cpu_info_t *cpus);
+extern int get_mem_info(uspace_mem_info_t *meminfo);
+extern size_t get_task_ids(task_id_t *ids, size_t size);
+extern int get_task_info(task_id_t id, task_info_t *info);
+extern size_t get_task_threads(thread_info_t *infos, size_t size);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/uptime.h
===================================================================
--- uspace/lib/c/include/uptime.h	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
+++ uspace/lib/c/include/uptime.h	(revision 30a54709ba36bc519d1ad3075734736c27daf220)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010 Stanislav Kozina
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */ 
+
+#ifndef LIBC_UPTIME_H_
+#define LIBC_UPTIME_H_
+
+#include <sys/types.h>
+#include <libarch/types.h>
+
+extern int get_uptime(uint64_t *uptime);
+
+#endif
+
+/** @}
+ */
