file = open("1",O_RDWR|O_CREAT);
struct stat fileStat;
if(fstat(file,&fileStat)!=0) return -1;
unsigned long int bufLength = fileStat.st_size;
char * buf = new char(bufLength);
int i = read(file,buf,bufLength);
close(file);
printf("%d, %d\n",bufLength,i);
В итоге возращается 2 разных значения. В чем дело - не знаю...