diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /unix/boot/bootlib/osopen.c | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'unix/boot/bootlib/osopen.c')
-rw-r--r-- | unix/boot/bootlib/osopen.c | 29 |
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); +} |