read system call reads up to n bytes of data from the file associated with the file descriptor f1 & places them in the data area buf . u can learn more reading any book about system programming in Linux or Unix , there's a lot of thing to learn other then acm.
code:
#include<unistd.h>
int main()
{
char buf[128] ;
int Read ;
Read=read(0,buf,128) ;
if( Read <0)
write(2,"Read error\n",20);
if( write(1,buf,Read)!=Read)
write(2,"Write error\n",20) ;
exit(0) ;
}
I ran this program at Fedora 3 using gcc . I think u can easily understnd it.