[SOLVED] Wierd serial behavior with C

What does this statement do:

tcflush(fd,TCIOFLUSH);

Are you sure you are not flushing stuff away, that you should keep ?

Having the Arduino code would also be helpfull.