________________________________________ Von: Arkadiusz Drabczyk [arkadiusz@xxxxxxxxxxxx] Gesendet: Mittwoch, 17. Juni 2020 19:30 An: Walter Harms Cc: Jakub Wilk; Michael Kerrisk; linux-man@xxxxxxxxxxxxxxx Betreff: Re: [PATCH] fread.3: Explain that file position is moved after calling fread()/fwrite() On Wed, Jun 17, 2020 at 07:46:25AM +0000, Walter Harms wrote: > Hi, > i do not think character is correct it would confuse fseek() it says: > "The new position, measured in bytes" ok, v2 already sent. > to make things more complicated fread has a "size" and returns the > number of "things" read (" This number equals the number of bytes > transferred only when size is 1."). > > therefor i would suggest to move the success case > > > +The file position indicator for the stream is advanced by the number > > > +of characters successfully read or written. > into the "description section" ok, let's see what Michael thinks about it. > And add a word about partial reads into the "return value" section. E.g. > to make clear what happens when you try to read size=10 while only 4 are left. > Isn't it already covered by this fragment: "If an error occurs, or the end of the file is reached, the return value is a short item count (or zero)." IMHO no, what does a "short item count" mean ? E.g. my size is 4 bytes and there are 3 bytes left to read. what is the return value and will the last few bytes ever read ? -- Arkadiusz Drabczyk <arkadiusz@xxxxxxxxxxxx>