summaryrefslogtreecommitdiff
path: root/sysdeps/nacl
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/nacl')
-rw-r--r--sysdeps/nacl/access.c7
-rw-r--r--sysdeps/nacl/nacl-interfaces.h4
2 files changed, 11 insertions, 0 deletions
diff --git a/sysdeps/nacl/access.c b/sysdeps/nacl/access.c
index 95a0fb726b..e07d5582d6 100644
--- a/sysdeps/nacl/access.c
+++ b/sysdeps/nacl/access.c
@@ -19,6 +19,13 @@
#include <unistd.h>
#include <nacl-interfaces.h>
+/* Test for access to FILE without setting errno. */
+int
+__access_noerrno (const char *file, int type)
+{
+ return NACL_CALL_NOERRNO (__nacl_irt_dev_filename.access (file, type), 0);
+}
+
/* Test for access to FILE. */
int
__access (const char *file, int type)
diff --git a/sysdeps/nacl/nacl-interfaces.h b/sysdeps/nacl/nacl-interfaces.h
index b7b45bbf38..edd3217489 100644
--- a/sysdeps/nacl/nacl-interfaces.h
+++ b/sysdeps/nacl/nacl-interfaces.h
@@ -113,4 +113,8 @@ __nacl_fail (int err)
#define NACL_CALL(err, val) \
({ int _err = (err); _err ? __nacl_fail (_err) : (val); })
+/* Same as NACL_CALL but without setting errno. */
+#define NACL_CALL_NOERRNO(err, val) \
+ ({ int _err = (err); _err ? _err : (val); })
+
#endif /* nacl-interfaces.h */