Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision 6c44036225de80ff6c2c43f95480748e8b3892bd)
+++ uspace/lib/c/Makefile	(revision 75c430e3f06e21429663d9c36e1d4a0a6f8c5660)
@@ -163,4 +163,5 @@
 	generic/stats.c \
 	generic/assert.c \
+	generic/bsearch.c \
 	generic/pio_trace.c \
 	generic/qsort.c \
Index: uspace/lib/c/generic/bsearch.c
===================================================================
--- uspace/lib/c/generic/bsearch.c	(revision 75c430e3f06e21429663d9c36e1d4a0a6f8c5660)
+++ uspace/lib/c/generic/bsearch.c	(revision 75c430e3f06e21429663d9c36e1d4a0a6f8c5660)
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018 Jiri Svoboda
+ * 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
+ * @brief Binary search.
+ */
+
+#include <bsearch.h>
+#include <stddef.h>
+
+/** Binary search.
+ *
+ * @param key Key to search for
+ * @param base Array of objects
+ * @param nmemb Number of objects in array
+ * @param size Size of each object
+ * @param compar Comparison function
+ */
+void *bsearch(const void *key, const void *base, size_t nmemb, size_t size,
+    int (*compar)(const void *, const void *))
+{
+	size_t pividx;
+	const void *pivot;
+	int r;
+
+	while (nmemb != 0) {
+		pividx = nmemb / 2;
+		pivot = base + size * pividx;
+
+		r = compar(key, pivot);
+		if (r == 0)
+			return (void *)pivot;
+
+		if (r < 0) {
+			/* Now only look at members preceding pivot */
+			nmemb = pividx;
+		} else {
+			/* Now only look at members following pivot */
+			nmemb = nmemb - pividx - 1;
+			base += size * (pividx + 1);
+		}
+	}
+
+	return NULL;
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/stdlib.c
===================================================================
--- uspace/lib/c/generic/stdlib.c	(revision 6c44036225de80ff6c2c43f95480748e8b3892bd)
+++ uspace/lib/c/generic/stdlib.c	(revision 75c430e3f06e21429663d9c36e1d4a0a6f8c5660)
@@ -166,4 +166,32 @@
 }
 
+/** Get environment list entry.
+ *
+ * Note that this function is not reentrant. The returned string is only
+ * guaranteed to be valid until the next call to @c getenv.
+ *
+ * @param name Entry name
+ * @return Pointer to string or @c NULL if not found
+ */
+char *getenv(const char *name)
+{
+	(void) name;
+	return NULL;
+}
+
+/** Execute command.
+ *
+ * @param string Command to execute or @c NULL
+ *
+ * @return If @a string is @c NULL, return zero (no command processor
+ *         available). If @a string is not @c NULL, return 1 (failure).
+ */
+int system(const char *string)
+{
+	if (string == NULL)
+		return 0;
+
+	return 1;
+}
 
 /** Compute quotient and remainder of int division.
Index: uspace/lib/c/include/bsearch.h
===================================================================
--- uspace/lib/c/include/bsearch.h	(revision 75c430e3f06e21429663d9c36e1d4a0a6f8c5660)
+++ uspace/lib/c/include/bsearch.h	(revision 75c430e3f06e21429663d9c36e1d4a0a6f8c5660)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2018 Jiri Svoboda
+ * 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_BSEARCH_H_
+#define LIBC_BSEARCH_H_
+
+#include <stddef.h>
+
+extern void *bsearch(const void *, const void *, size_t, size_t,
+    int (*)(const void *, const void *));
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/stdlib.h
===================================================================
--- uspace/lib/c/include/stdlib.h	(revision 6c44036225de80ff6c2c43f95480748e8b3892bd)
+++ uspace/lib/c/include/stdlib.h	(revision 75c430e3f06e21429663d9c36e1d4a0a6f8c5660)
@@ -38,4 +38,5 @@
 #include <_bits/size_t.h>
 #include <_bits/wchar_t.h>
+#include <bsearch.h>
 #include <malloc.h>
 #include <qsort.h>
@@ -74,5 +75,5 @@
 
 extern int rand(void);
-extern void srand(unsigned int seed);
+extern void srand(unsigned int);
 
 extern void abort(void) __attribute__((noreturn));
@@ -82,4 +83,7 @@
 extern int at_quick_exit(void (*)(void));
 extern void quick_exit(int);
+
+extern char *getenv(const char *);
+extern int system(const char *);
 
 extern int atoi(const char *);
Index: uspace/lib/c/test/stdlib.c
===================================================================
--- uspace/lib/c/test/stdlib.c	(revision 6c44036225de80ff6c2c43f95480748e8b3892bd)
+++ uspace/lib/c/test/stdlib.c	(revision 75c430e3f06e21429663d9c36e1d4a0a6f8c5660)
@@ -282,4 +282,83 @@
 }
 
+/** getenv function */
+PCUT_TEST(getenv)
+{
+	char *s;
+
+	s = getenv("FOO");
+	PCUT_ASSERT_NULL(s);
+}
+
+/** Test availability of command processor */
+PCUT_TEST(system_null)
+{
+	int rc;
+
+	rc = system(NULL);
+	PCUT_ASSERT_INT_EQUALS(0, rc);
+}
+
+/** Test running a command */
+PCUT_TEST(system_cmd)
+{
+	int rc;
+
+	/* This should fail as system is just a stub */
+	rc = system("/app/bdsh");
+	PCUT_ASSERT_INT_EQUALS(1, rc);
+}
+
+/** Comparison function for bsearch test */
+static int test_compar(const void *a, const void *b)
+{
+	const int *ia, *ib;
+
+	ia = (const int *)a;
+	ib = (const int *)b;
+
+	return *ia - *ib;
+}
+
+PCUT_TEST(bsearch)
+{
+	int numbers[] = { 1, 2, 6, 7, 7, 10, 100, 120 };
+	int k;
+	void *r;
+
+	k = 0;
+	r = bsearch(&k, numbers, sizeof(numbers) / sizeof(int), sizeof(int),
+	    test_compar);
+	PCUT_ASSERT_NULL(r);
+
+	k = 1;
+	r = bsearch(&k, numbers, sizeof(numbers) / sizeof(int), sizeof(int),
+	    test_compar);
+	PCUT_ASSERT_NOT_NULL(r);
+	PCUT_ASSERT_INT_EQUALS(1, *(int *)r);
+
+	k = 3;
+	r = bsearch(&k, numbers, sizeof(numbers) / sizeof(int), sizeof(int),
+	    test_compar);
+	PCUT_ASSERT_NULL(r);
+
+	k = 6;
+	r = bsearch(&k, numbers, sizeof(numbers) / sizeof(int), sizeof(int),
+	    test_compar);
+	PCUT_ASSERT_NOT_NULL(r);
+	PCUT_ASSERT_INT_EQUALS(6, *(int *)r);
+
+	k = 7;
+	r = bsearch(&k, numbers, sizeof(numbers) / sizeof(int), sizeof(int),
+	    test_compar);
+	PCUT_ASSERT_NOT_NULL(r);
+	PCUT_ASSERT_INT_EQUALS(7, *(int *)r);
+
+	k = 200;
+	r = bsearch(&k, numbers, sizeof(numbers) / sizeof(int), sizeof(int),
+	    test_compar);
+	PCUT_ASSERT_NULL(r);
+}
+
 /** Integer division */
 PCUT_TEST(div_func)
