delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/01/17/04:48:36

X-Spam-Check-By: sourceware.org
Message-ID: <45ADF0D2.8080809@sauvages.be>
Date: Wed, 17 Jan 2007 10:48:02 +0100
From: Stan Pinte <stan AT sauvages DOT be>
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Problem open(...) serial port /dev/com20 and tcgetattr(...)
OpenPGP: id=BC4F5802
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------enigAECAA8A942557639F172DC09
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello,

accessing serial port under cygwin, with ids above 10 is broken:

Using "/dev/com20" results in a "No such file or directory" error.

#include <unistd.h>
#include <fcntl.h>
#include <termios.h>

int main (int argument_count, char * arguments [])=20=20=20
{=20=20=20
    printf("opening com20:");
    int fd =3D open("/dev/com20", O_RDONLY | O_NONBLOCK);=20=20=20
    perror(NULL);
    struct termios options;
    int result =3D tcgetattr(fd, &options);
    perror(NULL);=20=20=20
}

The following post:
http://www.cygwin.com/ml/cygwin/1999-12/msg00323.html says I should use

"\\\\.\\com20" instead of "/dev/com20". If I do that, the call to open(...)=
 succeed,=20
but the call to tcgetattr raises a "Inappropriate ioctl for device" error.

I checked the example using "/dev/com3", and it works all right, so the
issue is limited to ports id above 9.

I already checked the following posts:
http://sourceware.org/ml/insight/2004-q4/msg00078.html, so it seems to
be a bug.

Do you have a workaround for this?

Kind regards,

Stan.


--------------enigAECAA8A942557639F172DC09
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFrfDS/PmuubxPWAIRAiCxAJ95plX8p3A4bK2ubyYSSJm+mfFu/ACfa+de
UTJAv6JaPmKlcXfdAqTABdw=
=oNLU
-----END PGP SIGNATURE-----

--------------enigAECAA8A942557639F172DC09--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019