[ale]Using write() and blocking
Chris Fowler
cfowler at outpostsentinel.com
Mon Nov 19 15:16:29 EST 2001
I have a piece of code that opens a tty in nonblocking mode. It them applies
tty seetings and using fcntl() to place that tty into blocking mode. After that line of
code I immediately do the following:
printf("Press enter to continue...");
fflush(stdout);
fgets(buffer, 2, stdin);
I expect the write() to block until the DCD on the serial port goes high. But the
write() takes place. It appears that the fgets or read() will block. Is this correct or
am I doing something wrong?
Goal:
1. Open tty and apply settings like modem control.
2.. Wait for phone call (DCD).
3. Give user menu of numbers to dial back on
4. drop DTR
5. Call user back
6. exec login on tty
7. restart when finished.
Thanks,
Chris
---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.
More information about the Ale
mailing list