to Eddi: why do you want to do it in "raw mode"???
Why makes things complicated when they are not!!!?
to RUST:
In Linux all input-output operations done through streams. Your program will have by default 3 stremas (input, output and error).
If you writing in c++ - names are cin, cout and cerr.
In C - there are 3 files: stdin, stdout and stderr.
they alerady opened by fopen, so all you need is just getc(stdin)
or getchar()