int myGets(char *srcbuf,int buflen,int fp)
{
char buf[4] = {0};
int count = 0;
if(srcbuf == NULL)
return 0;
while(read(fp,buf,1) > 0)
{
srcbuf[count++] = buf[0];
if((count >= buflen) || (buf[0] == '\n'))
{
break;
}
}
return count;
}