> Date: Fri, 15 May 2009 00:07:48 +0200 > From: [email protected] > > > Hi Gerel. > > The return description for fsys file read/write is wrong when using the > default > disk implementation, since fread/fwrite return the number of 'elements' > read/written, not the number of octets. > For them to return the number of octets they should be called like: > > fread/fwrite (data, 1, num_elems, file); /* note the '1' there */ > > An alternative would be to modify the API return semantics and return the > number > of elements read/write like fread/fwrite do, though I'm not sure if that > semantics is desired for other fsys implementations. > > Not really. To return the number of elements of size ELEM_SIZE is ok > given that we are specifying both ELEM_SIZE and ELEM_COUNT in the > call. >
I'm not against the ELEM_COUNT way, but that adds extra complexity for the rest of the fsys implementations (namely byte-oriented) . We can discuss this in the other email. cheers, -gerel
