[LCP]read - serial port programming

Andrew Weaver Andrew.Weaver at tecnomen.fi
Thu May 15 12:23:02 UTC 2003


On Wednesday, May 14, 2003 3:51 PM, michael bosu [SMTP:mfbosu at yahoo.com]
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 at yahoo.com
>


More information about the linuxCprogramming mailing list