[moving to gnulib, replies can drop autoconf] On 03/28/2010 03:54 PM, Philip Prindeville wrote: >>> Calling the sequence: >>> >>> setsockopt(fd, XXXX, IP_TOS,&foo, sizeof(foo)); >>> >>> can be tricky. Linux uses SOL_IP for XXXX, whereas Solaris and BSD use >>> IPPROTO_IP for this instead. >>> >>> Not sure what MacOS or HP-UX do. >>> >>> Do the newer versions of autoconf have canned code for detecting what to >>> use? >>> >> No. >> >> My version of Linux defines both SOL_IP and IPPROTO_IP to the same >> value. Since changing it would seem to break the API, I *think* >> if looking at Linux alone you should be able to just go with IPPROTO_IP. >> Untested, you get to keep the pieces if it breaks. >> > > Except, of course, that most people widely agree that using the protocol > number as a synonym for the layer number was a poor design choice, and > one that was eventually corrected (via the introduction of SOL_IP). > > Thus I would argue the opposite: that always using SOL_IP is the correct > approach, i.e. > > #ifndef SOL_IP > #define SOL_IP IPPROTO_IP > #endif > ... > > r = setsockopt(s, SOL_IP,&qos, sizeof(qos)); > > > In summary, the API was already broken, and propagating that usage model > is probably not a good thing. > > > >>> And if not, can someone please add it? >>> >>> I just grepped the 2.65 tarball but didn't find anything in there. >>> >> Generally, for such issues it might be a good idea to just use gnulib if >> you can; but I just looked and it doesn't address this particular issue >> yet. Anyone want to tackle making gnulib give better SOL_IP support, for those platforms that don't yet implement it? -- Eric Blake eblake@xxxxxxxxxx +1-801-349-2682 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf