aboutsummaryrefslogtreecommitdiff
path: root/unix/boot/bootlib/osopen.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/boot/bootlib/osopen.c')
-rw-r--r--unix/boot/bootlib/osopen.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/unix/boot/bootlib/osopen.c b/unix/boot/bootlib/osopen.c
new file mode 100644
index 00000000..42b3cdeb
--- /dev/null
+++ b/unix/boot/bootlib/osopen.c
@@ -0,0 +1,29 @@
+/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+ */
+
+#include <fcntl.h>
+#include "bootlib.h"
+
+extern int os_createfile (char *fname, int mode, int type);
+
+
+/* OS_OPEN -- Open or create a host system file for reading or writing (text
+ * and binary disk files only).
+ */
+int
+os_open (
+ char *vfn, /* file to be opened */
+ int mode, /* access mode 0=R, 1=W, 2=RW */
+ int type /* file type */
+)
+{
+ extern char *vfn2osfn();
+
+ if (mode == 0) {
+ osfiletype = BINARY_FILE;
+ return (open (vfn2osfn (vfn, 0), 0));
+ } else if (mode == 1) {
+ return (os_createfile (vfn, mode, type));
+ } else
+ return (-1);
+}