On Sun, May 2, 2010 at 5:33 PM, Neil O'Brien <nsob104@googlemail.com> wrote:
quoted text > 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
>
>
Hi,
Is the system running Linux running on the same type of board as your
OpenBSD system? If not, try running Linux on a system identical to
the one you're using - see if it's the board causing the problem.
Regards
--
Aaron Mason - Programmer, open source addict
I've taken my software vows - for beta or for worse