public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <derodat@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Corentin Gay <gay@adacore.com>
Subject: [Ada] Add case to consider ENODEV a "file not found error"
Date: Tue, 5 Oct 2021 08:26:41 +0000	[thread overview]
Message-ID: <20211005082641.GA2693635@adacore.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 638 bytes --]

Starting with VxWorks 21.03, a call to fopen() can now set errno to
ENODEV if a prefix of the path does not match any known device.  This
led the runtime to raise the wrong exception type when trying to a file
for which the parent directory did not exist and caused the acats
testsuite to fail. This patch adds a case to return 1 if errno has been
set to ENODEV. We don't bother with version checking as this affects
both kernel mode and RTP mode, and it does not affect runs done with
previous VxWorks versions.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* sysdep.c (__gnat_is_file_not_found_error): Add else if case.

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 571 bytes --]

diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c
--- a/gcc/ada/sysdep.c
+++ b/gcc/ada/sysdep.c
@@ -907,6 +907,10 @@ __gnat_is_file_not_found_error (int errno_val)
     if (errno_val == ENOENT)
       return 1;
 #ifdef __vxworks
+    /* Starting with VxWorks 21.03, the fopen() function can set errno to
+     * ENODEV when the prefix of the path does not match any known device. */
+    else if (errno_val == ENODEV)
+      return 1;
     /* In the case of VxWorks, we also have to take into account various
      * filesystem-specific variants of this error.
      */



                 reply	other threads:[~2021-10-05  8:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211005082641.GA2693635@adacore.com \
    --to=derodat@adacore.com \
    --cc=gay@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).