tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: setbuffer(3) size argument type int/size_t ?



In article <20091024211813.GA418209%medusa.sis.pasteur.fr@localhost>,
Nicolas Joly  <njoly%pasteur.fr@localhost> wrote:
>
>Hi,
>
>There seems to be an inconsistency with setbuffer(3) size argument.
>
>The man page states that its type is size_t but the implementation
>declare an int type ...
>
>src/lib/libc/stdio/setbuf.3:
>.Ft void
>.Fn setbuffer "FILE *stream" "char *buf" "size_t size"
>
>src/include/stdio.h:
>src/lib/libc/stdio/setbuffer.c:
>void     setbuffer(FILE *, char *, int);
>
>The size_t type looks more correct to handle a buffer size. Ok to
>convert the code ?

I guess so. setbuffer is the bsd variant that predates setvbuf and it
is very rarely used.

christos



Home | Main Index | Thread Index | Old Index