diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-20 12:35:11 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-20 12:35:11 +0000 |
commit | 76fc58b6e2a8a6122053dcfe9753790595a0e8fa (patch) | |
tree | d22b7988ca725589e64a5a1327e1a9cd93db79a5 /gcc/ada/sysdep.c | |
parent | 52d0b3bbbc4338940778b31729207c4633e75f42 (diff) | |
download | gcc-76fc58b6e2a8a6122053dcfe9753790595a0e8fa.tar.gz |
2008-08-20 Thomas Quinot <quinot@adacore.com>
* s-fileio.adb (Open) Use C helper function to determine whether a
given errno value corresponds to a "file not found" error.
* sysdep.c (__gnat_is_file_not_found_error): New C helper function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139283 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sysdep.c')
-rw-r--r-- | gcc/ada/sysdep.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index a8f24cd71e5..9028fb58589 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -35,9 +35,14 @@ #ifdef __vxworks #include "ioLib.h" +#include "dosFsLib.h" +#ifndef __RTP__ +# include "nfsLib.h" +#endif #include "selectLib.h" #include "vxWorks.h" #endif + #ifdef IN_RTS #define POSIX #include "tconfig.h" @@ -53,6 +58,7 @@ #endif #include <time.h> +#include <errno.h> #if defined (sun) && defined (__SVR4) && !defined (__vxworks) /* The declaration is present in <time.h> but conditionalized @@ -893,3 +899,23 @@ __gnat_get_task_options (void) } #endif + +int +__gnat_is_file_not_found_error (int errno_val) { + switch (errno_val) { + case ENOENT: +#ifdef __vxworks + /* In the case of VxWorks, we also have to take into account various + * filesystem-specific variants of this error. + */ + case S_dosFsLib_FILE_NOT_FOUND: +#ifndef __RTP__ + case S_nfsLib_NFSERR_NOENT: +#endif +#endif + return 1; + + default: + return 0; + } +} |