bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: On recent windows fileno return -2 in case of closed stdin, stdout,


From: Bruno Haible
Subject: Re: On recent windows fileno return -2 in case of closed stdin, stdout, stderr
Date: Mon, 06 Apr 2020 22:49:04 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-174-generic; KDE/5.18.0; x86_64; ; )

Bastien,

> > So the workaround would have to be in a 'fileno' module.
> 
> I can but I do not know how to do. does -2 is a valid fd on windows ?

On Windows as well, valid file descriptor numbers are >= 0. All return
values of fileno that are < 0 can be considered as invalid. But since POSIX
says that only -1 can be used as return value of fileno that indicates an
error, a bit of gnulib code is necessary.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]