Commit 479f9059 by Pascal Obry Committed by Arnaud Charlet

adaint.h, adaint.c (__gnat_open): Added.

2014-08-01  Pascal Obry  <obry@adacore.com>

	* adaint.h, adaint.c (__gnat_open): Added.
	* s-crtl.ads (open): Import __gnat_open for large file support.

From-SVN: r213411
parent 2b9fbec9
2014-08-01 Pascal Obry <obry@adacore.com>
* adaint.h, adaint.c (__gnat_open): Added.
* s-crtl.ads (open): Import __gnat_open for large file support.
2014-08-01 Robert Dewar <dewar@adacore.com>
* sem_case.adb (Dup_Choice): Improve message for integer constants.
......
......@@ -1219,6 +1219,27 @@ __gnat_open_new_temp (char *path, int fmode)
return fd < 0 ? -1 : fd;
}
int
__gnat_open (char *path, int fmode)
{
int fd;
#if defined (VMS)
fd = open (path, fmode, PERM, "mbc=16", "deq=64", "fop=tef");
#elif defined (__MINGW32__)
{
TCHAR wpath[GNAT_MAX_PATH_LEN];
S2WSC (wpath, path, GNAT_MAX_PATH_LEN);
fd = _topen (wpath, fmode, PERM);
}
#else
fd = GNAT_OPEN (path, fmode, PERM);
#endif
return fd < 0 ? -1 : fd;
}
/****************************************************************
** Perform a call to GNAT_STAT or GNAT_FSTAT, and extract as much information
** as possible from it, storing the result in a cache for later reuse
......
......@@ -143,6 +143,7 @@ extern FILE *__gnat_fopen (char *, char *, int,
char *);
extern FILE *__gnat_freopen (char *, char *, FILE *,
int, char *);
extern int __gnat_open (char *, int);
extern int __gnat_open_read (char *, int);
extern int __gnat_open_rw (char *, int);
extern int __gnat_open_create (char *, int);
......
......@@ -224,7 +224,7 @@ package System.CRTL is
pragma Import (C, unlink, "__gnat_unlink");
function open (filename : chars; oflag : int) return int;
pragma Import (C, open, "open");
pragma Import (C, open, "__gnat_open");
function close (fd : int) return int;
pragma Import (C, close, "close");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment