Which library are you using? Did you remember to enable the serial port muxes. In case you didn't, you will find the instructions o how to do it in: How to program UART serial from Linux on Galileo Gen 2?.
Have you been able to do this? I got the same issue