This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, libfortran] PR44931 For INPUT_UNIT, INQUIRE NAME= should not return "stdin"

On 25/07/2010 16:31, Jerry DeLisle wrote:
> On 07/25/2010 02:00 AM, Tobias Burnus wrote:
>> Dear Jerry, Dave, and Kai,
>> Dave and Kai: I have CCed you as I have a question regarding
>> MinGW/Cygwin.

  Forgot to actually Cc us!

>> Jerry DeLisle wrote:
>>> The attach patch uses ttyname to return the device file name for
>>> inquire by unit.
>>> Regression tested on x86-64.
>>> Test case attached, but the results are system dependent so I will not
>>> add it to the testsuite.
>> Kai, Dave: The idea is that INQUIRE returns for stdin, stdout, and
>> stderr a "filename", which can be used to '(re)open' ([re]associate) a
>> Fortran I/O unit number with those standard I/O "streams". (Non
>> normative note in the standard: "the value [for NAME=] returned [by
>> "INQUIRE(UNIT=...,NAME=...)"] shall be suitable for use as the value of
>> the file-name-expr in the FILE= specifier in an OPEN statement.")
>> Under Unix, ttynam should roughly do this, but I fear it might not work
>> under Windows - in particular under MinGW(.org,64). Or does it?
> ttynam is supported under Cygwin according to their documentation.  I
> will test it.

  I gave it a quick check, it works, returns "/dev/console" or "/dev/ttyN"
depending if you're running in a DOS box or a graphical shell.

> Regarding mingw-32/64 I will defer to Kai, but it looks like they do
> from googling.

  Kai Cc'd in.  Kai, thread begins at:

>> Would it be an option to use conout$, conin$ and conerr$ for those? I
>> think on MinGW, libgfortran (io/unix.c) uses them directly (well conerr$
>> = conout$) 

  That's how I understand it as well, so it makes a ton of sense to me if
those names get used here as well.

>> while on cygwin those are mapped to /dev/con{in,out,err}. At
>> least for MinGW this seems to be required as Windows does not seem to
>> have a tty concept. For Cygwin the Unix approach should work.

  And if it doesn't, we'll fix it in Cygwin for you :)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]