title: How to set a non-standard baudrate on a serial port device on Linux?
body: <p>What are the ways of setting custom baudrates on Linux?</p>
  
  <p>An answer to this question must be at a level of userland low-level APIs (<code>ioctl</code>, etc.) above the level of a syscall. It should be useful in these circumstances at least:</p>
  
  <ol>
  <li><p>Writing low-level C-based userland code that uses serial ports,</p></li>
  <li><p>Writing libraries that abstract the serial port functionality,</p></li>
  <li><p>Writing kernel serial port drivers.</p></li>
  </ol>