tcgetattr

tcgetattr is a Linux standard interface to get parameters from the terminal.

See Library Functions on the Linux man-pages project for more information.