//These are the Includes#include <stdio.h>#include <string.h>#include <unistd.h>#include <fcntl.h>#include <errno.h>#include <termios.h>int main(void){ int fd; //This variable represents port existence. // The ports ttyS1, ttyS2, and ttyS3 output 3 telling that they DO exist fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY); //Open the port. if (fd == 0) //If fd doesnt exist, then it didn't connect. { printf("Failed to connect...\n\a"); } else { fcntl(fd, F_SETFL, 0); //Supposed to display port data (broken) printf("%d\n", fd); //Supposed to display port data (fixed) } return (fd);}