Which serial device is linked to console(Linux)?
I want to find out which serial device (/dev/ttyS0-X) is linked to console so I can skip them from opening to prevent concurrent problems. This should be realized within a generic C/C++ function, that chec开发者_如何学JAVAks all tty devices and returns a selection of available (not linked to the console) serial devices.
Is there a way to get such information like from the Linux Kernel or the C/C++ file library?
try tty command it shows /dev/pts/0 if u open another console terminal it wil be /dev/pts/1..It shows the no terminal no you are in U can connect the devices in shell console
精彩评论