This is what I use in my hcsd program (9600 baud). I also use read and write. To get the entire source take a look at the following link: http://home.comcast.net/~ncherry/common/hcs.tar.gz The files you are interested in are hcsd_setup.c (the partial source is below) and hcsd_io.c (there the xread and xwrite are). The code below has most of it's comments removed (the comments are important so read them). if((device=open(line, O_RDWR|O_NOCTTY|O_NONBLOCK)) < 0) { syslog(LOG_ERR, "%s: %m", line); exit(errno); } /* ** This works for heyu (NJC) */ i = tcgetattr(device, &oldsb); if (i < 0) { syslog(LOG_CRIT, strerror(errno)); exit(errno); } newsb = oldsb; newsb.c_iflag = IGNBRK | IGNPAR; newsb.c_oflag = 0; newsb.c_lflag = ISIG; newsb.c_cflag = (CLOCAL | B9600 | CS8 | CREAD); for (i = 0; i < NCC; i++) newsb.c_cc[i] = 0; newsb.c_cc[VMIN] = 126; newsb.c_cc[VTIME] = 0; newsb.c_cc[VQUIT] = 0; newsb.c_cc[VSTART] = 0; newsb.c_cc[VSTOP] = 0; newsb.c_cc[VSUSP] = 0; tcsetattr(device, TCSADRAIN, &newsb); -- Linux Home Automation Neil Cherry ncherry@comcast.net http://home.comcast.net/~ncherry/ (Text only) http://linuxha.sourceforge.net/ (SourceForge) http://hcs.sourceforge.net/ (HCS II) -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics