summaryrefslogtreecommitdiff
path: root/emu/port/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'emu/port/file.c')
-rw-r--r--emu/port/file.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/emu/port/file.c b/emu/port/file.c
new file mode 100644
index 00000000..91000ebb
--- /dev/null
+++ b/emu/port/file.c
@@ -0,0 +1,16 @@
+#include "dat.h"
+#include "fns.h"
+#include "error.h"
+
+int
+openmode(ulong o)
+{
+ if(o >= (OTRUNC|OCEXEC|ORCLOSE|OEXEC))
+ error(Ebadarg);
+ o &= ~(OTRUNC|OCEXEC|ORCLOSE);
+ if(o > OEXEC)
+ error(Ebadarg);
+ if(o == OEXEC)
+ return OREAD;
+ return o;
+}