X-Recipient: archive-cygwin@delorie.com X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: References: Date: Sat, 28 Aug 2010 05:37:12 +0100 Message-ID: Subject: Re: Support for the TIOCINQ ioctl From: Andy Koppe To: brennan@sellner.org, cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Delivered-To: mailing list cygwin@cygwin.com On 27 August 2010 23:31, Brennan Peter Sellner wrote: > By any chance, has support for the TIOCINQ ioctl on file descriptors (used > to check how many bytes of data are in the input buffer) been added to > Cygwin? =C2=A0It hadn't as of 2004: > > =C2=A0http://sourceware.org/ml/cygwin/2004-07/msg00910.html It's still implemented only for serial devices. > ...but I haven't found any newer references to it. =C2=A0I'm inferring th= at it's > not supported, as ioctl(fd, TIOCINQ, &available) (where fd is a valid file > descriptor, and available is a long) fails, with errno set to 'invalid > argument'. =C2=A0I'm running Cygwin 1.7.6 on Vista. > > I'm hoping I'm missing something... =C2=A0Is there an alternative way to = check > the number of bytes on an fd's input buffer in Cygwin? What's your use case? And on what sort of fd? select() of course can tell you whether there are any bytes available to be read from an fd, and usually that's all one needs to know. Andy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple