title: Possible to use a 9 Pin Serial port as "GPIO" using ioctl()?
body: <p>Is it possible to use the COM port on a linux box to read the value of a switch? I think that it should be possible with ioctl(), but i have struggled a little to find a comparable example. I only need one input, and only need it to read in a HIGH/LOW value. I thought I could just use ioctl to set one of the pins high, and wire a switch between that and another pin, again using ioctl to read the value of the second pin()</p>
  
  <p>The rationale is that I have a trusty old server running in the garage, I'd like to make something that would bleep and tell if the garage door is open, Since the server sits next to the door, I thought it would be simple to just wire a switch into the back of the com port (which is currently unused)</p>
  
  <p><em>Granted, I could spend a few pounds, save myself a headache and use an arduino or an ESP8266, but this has now got me curious!</em></p>