[FFmpeg-devel] [PATCH] adding _GNU_SOURCE for udp.c compilation

Nicolas George nicolas.george
Sun Feb 10 19:20:31 CET 2008


Le duodi 22 pluvi?se, an CCXVI, Reimar D?ffinger a ?crit?:
> Well in my header file (gentoo and debian) they are claimed to be part of
> POSIX1.g, so they are not under a GNU ifdef.
> Though I admit I could not find it in the POSIX specs I had lying
> around.

Neither NI_MAXSERV nor NI_MAXHOST appear in the Single Unix Specification
version 3, which is a superset of POSIX.


shows that the check for _GNU_SOURCE has been added three weeks ago, with
the log message "Cleanup namespace.".

getnameinfo seems to return EAI_OVERFLOW if the buffers are not big enough.
EAI_OVERFLOW is standard, and described in the SUSv3 about netdb.h, but not
referenced in the page about getnameinfo.

I fear that the only absolutely reliable way of doing this is to increase
dynamically the buffer each time EAI_OVERFLOW is returned. Yet, using
NI_MAX* when they are defined as the initial size for the buffer should be
helpful nonetheless.


  Nicolas George

More information about the ffmpeg-devel mailing list