summaryrefslogtreecommitdiff
path: root/src/os_posix/os_errno.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_posix/os_errno.c')
-rw-r--r--src/os_posix/os_errno.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/os_posix/os_errno.c b/src/os_posix/os_errno.c
index a58ae88447e..a0f1202c6ef 100644
--- a/src/os_posix/os_errno.c
+++ b/src/os_posix/os_errno.c
@@ -23,6 +23,22 @@ __wt_errno(void)
}
/*
+ * __wt_map_error_rdonly --
+ * Map an error into a WiredTiger error code specific for
+ * read-only operation which intercepts based on certain types
+ * of failures.
+ */
+int
+__wt_map_error_rdonly(int error)
+{
+ if (error == ENOENT)
+ return (WT_NOTFOUND);
+ else if (error == EACCES)
+ return (WT_PERM_DENIED);
+ return (error);
+}
+
+/*
* __wt_strerror --
* POSIX implementation of WT_SESSION.strerror and wiredtiger_strerror.
*/