Re: Redefining inet_net_ntop

2018-01-28 Thread Craig Ringer
On 29 January 2018 at 17:07, Tom Lane wrote: > > Another choice would be to stick a pg_ prefix on the function name. > That, plus a comment, seems just fine to me. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: Redefining inet_net_ntop

2018-01-28 Thread Tom Lane
Craig Ringer writes: > On 27 January 2018 at 04:27, Tom Lane wrote: >> Almost certainly, the thing to do is absorb updated code from bind, >> not roll our own. > I asked because I didn't see any comments explaining why we had it and why > we built it even when the local system has support for it

Re: Redefining inet_net_ntop

2018-01-28 Thread Craig Ringer
On 27 January 2018 at 04:27, Tom Lane wrote: > Emre Hasegeli writes: > >> port.h declares inet_net_ntop and we always compile our own from > >> port/inet_net_ntop.c . > > > There is another copy of it under backend/utils/adt/inet_cidr_ntop.c. > > The code looks different but does 90% the same th

Re: Redefining inet_net_ntop

2018-01-26 Thread Tom Lane
Emre Hasegeli writes: >> port.h declares inet_net_ntop and we always compile our own from >> port/inet_net_ntop.c . > There is another copy of it under backend/utils/adt/inet_cidr_ntop.c. > The code looks different but does 90% the same thing. Their naming > and usage is confusing. > I recently

Re: Redefining inet_net_ntop

2018-01-26 Thread Emre Hasegeli
> port.h declares inet_net_ntop and we always compile our own from > port/inet_net_ntop.c . There is another copy of it under backend/utils/adt/inet_cidr_ntop.c. The code looks different but does 90% the same thing. Their naming and usage is confusing. I recently needed to format IP addresses as

Re: Redefining inet_net_ntop

2018-01-25 Thread Tom Lane
Craig Ringer writes: > Should we be using our own if the OS has it? I'm thinking of adding a test > to configure and omitting our own version if configure finds it. Objections? I can't imagine that there's any real upside here. The amount of code involved is barely over a kilobyte, and we'd be e

Re: Redefining inet_net_ntop

2018-01-25 Thread Peter Eisentraut
On 1/25/18 22:24, Craig Ringer wrote: > port.h declares inet_net_ntop and we always compile our own > from port/inet_net_ntop.c . > > But it's part of -lresolv on Linux, and more importantly, it's declared > in . > > Should we be using our own if the OS has it? I'm thinking of adding a > test to

Redefining inet_net_ntop

2018-01-25 Thread Craig Ringer
Hi folks port.h declares inet_net_ntop and we always compile our own from port/inet_net_ntop.c . But it's part of -lresolv on Linux, and more importantly, it's declared in . Should we be using our own if the OS has it? I'm thinking of adding a test to configure and omitting our own version if co