Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: fusl/src/fcntl/openat.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fusl/src/fcntl/open.c ('k') | fusl/src/fcntl/posix_fadvise.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/src/fcntl/openat.c
diff --git a/fusl/src/fcntl/openat.c b/fusl/src/fcntl/openat.c
new file mode 100644
index 0000000000000000000000000000000000000000..e741336c6f5587d3c4e8db596b41e48f73601a3b
--- /dev/null
+++ b/fusl/src/fcntl/openat.c
@@ -0,0 +1,20 @@
+#include <fcntl.h>
+#include <stdarg.h>
+#include "syscall.h"
+#include "libc.h"
+
+int openat(int fd, const char *filename, int flags, ...)
+{
+ mode_t mode = 0;
+
+ if ((flags & O_CREAT) || (flags & O_TMPFILE) == O_TMPFILE) {
+ va_list ap;
+ va_start(ap, flags);
+ mode = va_arg(ap, mode_t);
+ va_end(ap);
+ }
+
+ return syscall_cp(SYS_openat, fd, filename, flags|O_LARGEFILE, mode);
+}
+
+LFS64(openat);
« no previous file with comments | « fusl/src/fcntl/open.c ('k') | fusl/src/fcntl/posix_fadvise.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698