[PATCH v3 4/5] pcapng: avoid using alloca()

Stephen Hemminger stephen at networkplumber.org
Thu Nov 9 16:44:49 CET 2023


On Thu, 9 Nov 2023 09:21:22 +0100
Morten Brørup <mb at smartsharesystems.com> wrote:

> I can't find the definition of BUFSIZ. Please make sure to add a comment to the definition of BUFSIZ mentioning - like in your patch description - that it will be more than sufficient for the info related blocks in the file.
> 
> More comments inline below, regarding existing bugs found while reviewing.
> 
> 
> Assuming BUFSIZ has a comment describing the reason for its value,
> 
> Acked-by: Morten Brørup <mb at smartsharesystems.com>

The constant BUFSIZ comes from stdio.h and used lots of places in libraries.
It is 8192 in current glibc and unlikely to be a problem.
Chose it because this a on stack buffer used before writing to a file which
is similar to what stdio does.

The library does not use stdio because most of the I/O is writing packets
which needs to be fast and overhead of extra stdio buffer is harmful.
Looking into using io_uring in a future version.


More information about the dev mailing list