Index: uspace/lib/posix/include/posix/fcntl.h
===================================================================
--- uspace/lib/posix/include/posix/fcntl.h	(revision a3da2b2ee2ac5f4fadec2282a5f5974b52b2a6f3)
+++ uspace/lib/posix/include/posix/fcntl.h	(revision ca4c6ec120df951515086223141c087ee2cca836)
@@ -72,19 +72,10 @@
 #define FD_CLOEXEC         1 /* Close on exec. */
 
-#undef open
-#define open(path, ...) \
-	({ \
-		int rc = open(path, ##__VA_ARGS__); \
-		if (rc < 0) { \
-			errno = -rc; \
-			rc = -1; \
-		} \
-		rc; \
-	})
-
+extern int posix_open(const char *pathname, int flags, ...);
 extern int posix_fcntl(int fd, int cmd, ...);
 
 #ifndef LIBPOSIX_INTERNAL
 	#define fcntl posix_fcntl
+	#define open posix_open
 #endif
 
Index: uspace/lib/posix/source/fcntl.c
===================================================================
--- uspace/lib/posix/source/fcntl.c	(revision a3da2b2ee2ac5f4fadec2282a5f5974b52b2a6f3)
+++ uspace/lib/posix/source/fcntl.c	(revision ca4c6ec120df951515086223141c087ee2cca836)
@@ -95,4 +95,29 @@
 }
 
+/**
+ * Open, possibly create, a file.
+ *
+ * @param pathname Path to the file.
+ * @param flags Access mode flags.
+ */
+int posix_open(const char *pathname, int flags, ...)
+{
+	mode_t mode = 0;
+	if ((flags & O_CREAT) > 0) {
+		va_list args;
+		va_start(args, flags);
+		mode = va_arg(args, mode_t);
+		va_end(args);
+	}
+
+	int rc = open(pathname, flags, mode);
+	if (rc < 0) {
+		errno = -rc;
+		rc = -1;
+	}
+
+	return rc;
+}
+
 /** @}
  */
