* UPDATE: select on COM port
@ 1997-03-24 17:23 mgaluza
0 siblings, 0 replies; only message in thread
From: mgaluza @ 1997-03-24 17:23 UTC (permalink / raw)
To: tru64-unix-managers
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
----------------------------------------------------------------------
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1997-03-24 17:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-03-24 17:23 UPDATE: select on COM port mgaluza
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox