Index: uspace/lib/posix/sys/stat.c
===================================================================
--- uspace/lib/posix/sys/stat.c	(revision 3f466c33de0de672c03cfdba923d8079460d710a)
+++ uspace/lib/posix/sys/stat.c	(revision ddc63fda6abb8779ebc12f210cfc26c08d33ebc9)
@@ -39,4 +39,5 @@
 #include "stat.h"
 
+#include "../errno.h"
 #include "../libc/mem.h"
 
@@ -76,6 +77,9 @@
 {
 	struct stat hst;
-	if (fstat(fd, &hst) == -1) {
-		// TODO: propagate a POSIX compatible errno
+	int rc = fstat(fd, &hst);
+	if (rc < 0) {
+		/* fstat() returns negative error code instead of using errno.
+		 */
+		errno = -rc;
 		return -1;
 	}
@@ -107,6 +111,9 @@
 {
 	struct stat hst;
-	if (stat(path, &hst) == -1) {
-		// TODO: propagate a POSIX compatible errno
+	int rc = stat(path, &hst);
+	if (rc < 0) {
+		/* stat() returns negative error code instead of using errno.
+		 */
+		errno = -rc;
 		return -1;
 	}
