Index: uspace/lib/posix/getopt.c
===================================================================
--- uspace/lib/posix/getopt.c	(revision af42a2bf32988d827b889020c0e2c9840f8652ce)
+++ uspace/lib/posix/getopt.c	(revision 422af2b1e7236addac60aba765ad4a3d606b1365)
@@ -42,5 +42,13 @@
     const char *opt_string, const struct option *long_opts, int *long_index)
 {
-	return getopt_long(argc, argv, opt_string, long_opts, long_index);
+	int rc = getopt_long(argc, argv, opt_string, long_opts, long_index);
+	posix_optarg = (char *) optarg;
+	return rc;
 }
 
+int posix_getopt(int argc, char * const argv[], const char *opt_string)
+{
+	int rc = getopt(argc, argv, opt_string);
+	posix_optarg = (char *) optarg;
+	return rc;
+}
Index: uspace/lib/posix/unistd.h
===================================================================
--- uspace/lib/posix/unistd.h	(revision af42a2bf32988d827b889020c0e2c9840f8652ce)
+++ uspace/lib/posix/unistd.h	(revision 422af2b1e7236addac60aba765ad4a3d606b1365)
@@ -45,5 +45,5 @@
 extern char *posix_optarg;
 extern int optind, opterr, optopt;
-extern int getopt(int, char * const [], const char *);
+extern int posix_getopt(int, char * const [], const char *);
 
 /* Environment */
@@ -143,4 +143,5 @@
 
 #ifndef LIBPOSIX_INTERNAL
+	#define getopt posix_getopt
 	#define optarg posix_optarg
 
