title: How to detect if /dev/ttyGS0 is connected or not
body: <p>I am writing a c++ program on my linux device where I can connect the device's micro usb to my computers (host) USB port. I want my program to detect if /dev/ttyGS0 has a device connected to it or not and if it does, I want my device to connect to it right away without having to send any data from my computer. And if it disconnects, I want it to also detect that and close the port. I do not want to use libusb for this. I want to use a different library.
  As of now, I am using the fcntl.h library. I'm open to any other libraries and suggestions.</p>