On Sat, May 01, 2010 at 15:30:28 -0700, J.C. Roberts wrote:
> >   status = tcsetattr(fd, TCSANOW, &options);
>
> How does it behave if you use "TCSAFLUSH" rather than "TCSANOW" ?

I made that substitution and added a
#define DEBUG 1

The resulting binary sometimes fails to return and I then have to
hit ctrl-c.  I've tried it several times, and not seen any (repeating)
pattern in terms of when it works and when it fails.

Here's some typical output:

# grep TCSA ex_obsd_flush.c
 status = tcsetattr(fd, TCSAFLUSH, &options);
# cc -Wall -o ex_obsd_flush ex_obsd_flush.c
# time ./ex_obsd_flush
Port has been opened and set up
1 bytes available, read: 6
    0m1.21s real     0m0.00s user     0m0.00s system
# time ./ex_obsd_flush
Port has been opened and set up
^C    0m6.07s real     0m0.00s user     0m0.00s system

# time ./ex_obsd_flush
Port has been opened and set up
^C    0m7.49s real     0m0.00s user     0m0.00s system

# time ./ex_obsd_flush
Port has been opened and set up
1 bytes available, read: 6
    0m1.21s real     0m0.00s user     0m0.00s system

Following this I had two more failures, one success, one failure and
one success in that order.

--
Neil

Reply via email to