summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.rst5
-rw-r--r--libgcompat/unistd.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index f97724f..edc96f5 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -68,6 +68,11 @@ string
* Add memfrob.
* Add strfry.
+unistd
+------
+
+* Add __open_2/__open64_2.
+
malloc
------
diff --git a/libgcompat/unistd.c b/libgcompat/unistd.c
index e19ec8e..d2f3097 100644
--- a/libgcompat/unistd.c
+++ b/libgcompat/unistd.c
@@ -1,4 +1,5 @@
#include <assert.h> /* assert */
+#include <fcntl.h> /* O_CREAT */
#include <limits.h> /* NGROUPS_MAX */
#include <stddef.h> /* NULL, size_t */
#include <unistd.h> /* confstr, getcwd, getgroups, ... */
@@ -90,6 +91,14 @@ pid_t __getpgid(pid_t pid)
return getpgid(pid);
}
+int __open_2(const char *path, int oflag)
+{
+ assert(!(oflag & O_CREAT));
+
+ return open(path, oflag);
+}
+alias(__open_2, __open64_2);
+
/**
* Read from a file, with buffer overflow checking.
*