X-Spam-Check-By: sourceware.org Message-ID: <451BBA05.9050808@byu.net> Date: Thu, 28 Sep 2006 06:03:17 -0600 From: Eric Blake User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.666 MIME-Version: 1.0 To: cygwin AT cygwin DOT com, ahnkle AT ekers DOT idps DOT co DOT uk Subject: Re: tcgetattr problem References: <20060927193049 DOT GA29552 AT flixx DOT linux DOT bogus> <20060927231017 DOT GC29552 AT flixx DOT linux DOT bogus> <20060928021335 DOT GD31675 AT trixie DOT casa DOT cgf DOT cx> <20060928023857 DOT GG31675 AT trixie DOT casa DOT cgf DOT cx> <20060928082915 DOT GD29552 AT flixx DOT linux DOT bogus> In-Reply-To: <20060928082915.GD29552@flixx.linux.bogus> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to ahnkle on 9/28/2006 2:29 AM: > > I said "_ioctl" because in cygwin source, at src/newlib/libc/sys/sysvi386/tcgetattr.c > the call is to that function. Searching didn't locate any [_]ioctl() function, hence > my asking. The linker tends to add a leading underscore; in the cygwin sources, it would be ioctl(), not _ioctl(). newlib/libc/sys/sysvi386 is NOT part of cygwin. It would be under src/winsup/cygwin instead. > > My point in mentioning that com1 works is that it could be confusing that "com1" works > with open(), but the handle obtained doesn't work with tcgetattr(), whereas "/dev/ttyS0" > works with both. How many times do we have to say it? com1 works with open because it is a valid file name, but cygwin treats it like a disk file, and you can't do ioctl on a disk file. /dev/ttyS0 on the other hand is the cygwin-sanctioned name of the serial port (as it is in Linux, by the way), and cygwin opens it as a serial device instead of a disk file, and hence will support ioctl. Use the correct device name, not the windows back door, and your program will do what you want. We are not about to slow down open() to special case whether the string passed to it was the relative name com1, because there are too many other relative-looking windows magic filenames; instead open looks for the absolute path /dev/ and treats devices specially with a minimal impact to the rest of file-opening code. - -- Life is short - so eat dessert first! Eric Blake ebb9 AT byu DOT net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFG7oF84KuGfSFAYARAomcAKCg77UWgcZQA8t43Bn5HfdGzKGa1QCfTKBt EGAqDs8p5pUw+lfBTqcGKQM= =OQXA -----END PGP SIGNATURE----- -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/