[HACKERS] Why are we including netinet/tcp.h so widely?
[HACKERS] Why are we including netinet/tcp.h so widely?
От:
Andres Freund <andres@anarazel.de>
Дата:
Hi,
A lot of files which currently include netinet/tcp.h. For most of them I
cannot recognize why, and it just seems to have been copied from one
file to the next.
E.g.
src/interfaces/libpq/{fe-secure,fe-protocol3,fe-protocol2,fe-secure}.c
src/backend/libpq/{be-secure,be-secure-openssl}.c
and probably some more.
Not that it's particularly harmful to include a superflous include, but
due to the #ifdef HAVE_NETINET_TCP_H it's three lines, and it seems to
be copied enough that I got curious.
Any reason that I'm missing? Old platforms? I couldn't find anything in
the archives.
Greetings,
Andres Freund
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] Why are we including netinet/tcp.h so widely?
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Andres Freund writes: > A lot of files which currently include netinet/tcp.h. For most of them I > cannot recognize why, and it just seems to have been copied from one > file to the next. According to POSIX, that supplies TCP_NODELAY, and a look into the file here finds these other symbols we care about: #define TCP_KEEPIDLE 4 /* Start keeplives after this period */ #define TCP_KEEPINTVL 5 /* Interval between keepalives */ #define TCP_KEEPCNT 6 /* Number of keepalives before death */ Probably you could drop it from any file not using any TCP_xxx symbols. I'd be a little wary of #ifdef checks in any file you're about to remove it from, though, as those could mask any obvious breakage. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers