#include #include #include #include #include #ifndef PORT #define PORT "com1" #endif int main(int argc, char** argv) { int fd; fd = open(PORT, O_RDWR | O_NOCTTY ); if (fd < 0) { perror(PORT); return -1; } else { struct termios oldtio; int rc = tcgetattr(fd,&oldtio); /* save current port settings */ if (rc != 0) { printf("ERROR: tcgetattr returned %i (errno=%i)\n", rc, errno); return -1; } close(fd); } return 0; } // Local variables: // compile-command: "gcc -g -Wall test1.cpp -o test1" // End: