On Wed, Nov 01, 2017 at 01:57:18PM +0000, David Howells wrote:
> Eric Biggers <ebigge...@gmail.com> wrote:
> 
> > -     As much of the data as can be fitted into the buffer will be copied to
> > -     userspace if the buffer pointer is not NULL.
> > -
> > -     On a successful return, the function will always return the amount of 
> > data
> > -     available rather than the amount copied.
> > +     On success, the function will return the amount of data placed into 
> > the
> > +     buffer.
> >  
> > +     If the specified buffer is too small, then the size of the buffer 
> > required
> > +     will be returned, and it is unspecified whether any data will be 
> > copied
> > +     into the buffer.
> 
> How about:
> 
>      If the specified buffer is too small, then the size of the buffer
>      required will be returned.  Note that, in this case, the contents of the
>      buffer may be have been overwritten in some undefined way.
> 
>      Otherwise, on success, the function will return the amount of data copied
>      into the buffer.
> 
> David

I guess that's fine --- either way users can't rely on the contents of the
buffer.  The man page should use the same wording, though.  Should I send a v2
of both patches?

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to