This is the mail archive of the gcc-patches@gcc.gnu.org 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 Jul 2010, at 10:39, Tobias Burnus wrote:


Thomas Koenig wrote:
Tobias Burnus wrote
Besides, I wonder whether using "" as string is better than using the
default std{in,out,err} in case ttyname fails. (This happens for
instance if the standard I/O redirected to a file or pipe.)


For Linux, we could return /proc/self/fd/1 for standard output (0 and 2
correspondingly). This appears to work, as this little program shows:



Well, I think using /dev/std{in,out,err} is more portable than /proc/self/fd/{0,1,2}.

FWIW:


/dev/std{in,out,err} exist on Darwin

/proc does not.

cheers,
Iain


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