read returns number of bytes read or -1 for error. if u are using serial port for socket communication it is better to read data using recv. On Wed, 14 May 2003 michael bosu wrote : >Hi, > >Please to read from the serial port, what does the >function read return. For instance if the code below >return 8 for count. Does that mean the number of bytes >is 8 or what? > >Also if I want to get the actual bytes received how do >I go about it. > > >if ((count = read(fd, &vbuf[vlen], BUFFERSIZE - vlen)) >== -1) { > > perror("read"); > exit(1); > > } > >Thank you, >Michael mfbosu@yahoo.com > >__________________________________ >Do you Yahoo!? >The New Yahoo! Search - Faster. Easier. Bingo. >http://search.yahoo.com >_______________________________________________ >This is the Linux C Programming List >: http://lists.linux.org.au/listinfo/linuxcprogramming List