fix it with your baudrate and portname then compile and run. It runs on linux.
gcc main.c -o serial
Program creates log.txt file to add outputs in it. Also it shows outputs on terminal window.
You can install cutecom on ubuntu to see your serial outputs.
Ubuntu: sudo apt-get install -y cutecom