summaryrefslogtreecommitdiff
path: root/emu/port/file.c
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2009-03-25 15:55:14 +0000
committerCharles.Forsyth <devnull@localhost>2009-03-25 15:55:14 +0000
commitdfd1934d5e1ddbeb326f77fc0e52307c801a1a3e (patch)
treef1e8b23278caae95e01d88b00421d6c3642357ef /emu/port/file.c
parent78dfdcbd59dc8f36975e7695933e3f753957474c (diff)
x20090325-1554
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;
+}