From: mgaluza () dejarnette ! com (Mike Galuza)
To: tru64-unix-managers
Subject: UPDATE: select on COM port
Date: Mon, 24 Mar 1997 17:23:04 +0000 [thread overview]
Message-ID: <96078609810609.tru64-unix-managers.marc@archive.invalid> (raw)
It turns out that you CAN do a select on a COM port. I took a look
at the mgetty source code as Rob Urban had suggested. Although I
didn't see any glaring errors at first glance I did see a few subtle
things they were doing differently. One involved the first parameter
to select, nfds (number of fds). I was passing one, while they were
passing FD_SETSIZE, the system maximum. I tried using that value and
it worked! After some experimenting I found that any value greater
than 3 worked. It took me a while to figure it out, but I think the
problem is that stdin, stdout and stderr take up the first 3 fds, and
my fd is the 4th. So when I pass 1 to select it only looks at the
first fd, stdin. I have to pass 4 for nfds so that mine is seen.
Alternatively, I closed stdin before opening my fd and then my fd was
0 and was seen as the first one, so an nfds of 1 works in that case.
Anyway, having select available will save me a lot of work.
Thanks,
Mike
----------------------------------------------------------------------
Michael Galuza
DeJarnette Research Systems mgaluza@dejarnette.com
401 Washington Ave Suite 700 Voice: +1(410)583-0680 x691
Towson, MD 21204 Fax: +1(410)583-0696
----------------------------------------------------------------------
reply other threads:[~1997-03-24 17:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox