开发者

Which serial device is linked to console(Linux)?

开发者 https://www.devze.com 2023-04-05 21:35 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消