summaryrefslogtreecommitdiffstats
path: root/src/bfstd.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-01-22 14:20:51 -0500
committerTavian Barnes <tavianator@tavianator.com>2023-01-22 14:20:51 -0500
commitd2f3a10f4373610e912e586814e26e2a06fd7d88 (patch)
tree533f24bf1bc9594f8af11ebae1a72b9ff710897b /src/bfstd.h
parentca00b621eba1bf8b2a591b943090ac8af605922d (diff)
downloadbfs-d2f3a10f4373610e912e586814e26e2a06fd7d88.tar.xz
bfstd: Add O_SEARCH/O_EXEC fallbacks
Diffstat (limited to 'src/bfstd.h')
-rw-r--r--src/bfstd.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bfstd.h b/src/bfstd.h
index d46fa02..79307cc 100644
--- a/src/bfstd.h
+++ b/src/bfstd.h
@@ -33,6 +33,22 @@ bool is_nonexistence_error(int error);
#include <fcntl.h>
+#ifndef O_EXEC
+# ifdef O_PATH
+# define O_EXEC O_PATH
+# else
+# define O_EXEC O_RDONLY
+# endif
+#endif
+
+#ifndef O_SEARCH
+# ifdef O_PATH
+# define O_SEARCH O_PATH
+# else
+# define O_SEARCH O_RDONLY
+# endif
+#endif
+
#ifndef O_DIRECTORY
# define O_DIRECTORY 0
#endif