Still more #ifdef fun: struct sockaddr_storage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Still more #ifdef fun: struct sockaddr_storage
Date: 2006-07-15 16:22:03
Message-ID: 16940.1152980523@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pgcheckdefines reports

src/port/getaddrinfo.c references HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN, defined in src/include/libpq/pqcomm.h

I think this is an actual bug: if we have a platform that calls its
struct sockaddr_storage member __ss_len, and we are using our own
getaddrinfo code, we will fail to initialize the length member of
the returned ai_addr struct.

It would be safe to include src/include/libpq/pqcomm.h into
getaddrinfo.c, but it seems a tad ugly. Perhaps the machinations
in pqcomm.h to normalize the sockaddr_storage names ought to be
moved into a separate header file? If so, where to put it?

regards, tom lane

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian G. Pflug 2006-07-15 16:22:12 RFC: A dead simple implementation of pg_rotate_wal
Previous Message Sergey E. Koposov 2006-07-15 16:12:58 PG_RETURN_INT64 vs PointerGetDatum & ANALYZE