How do I know whether my device is attached to tty?
Posted on 1997-08-20
I'm using AIX Ver 4.1 on IBM server.
In a C program, how do I know whether my device is attached to tty? My device is asynchronous.
If my device is not attached, my program will hang on the following sentence : read(port, buf, 22);
I've tried using the following sentences but to no avail:
port = open(PORT, O_RDWR | O_NODELAY);
port = open(PORT, O_RDWR | O_NONBLOCK);