Re: recvfrom() params discrepancy

Pontus Lidman (pontus@lysator.liu.se)
Sat, 13 Mar 1999 11:25:05 +0100 (MET)


On Fri, 12 Mar 1999, Tuan Hoang wrote:

> Hi,
>
> I have code that is for both red hat (glibc 2.0.7) & slackware
> (libc5) linux and solaris 2.6 x86. The recvfrom() parameters in the man
> pages specify that the fromlen parameter be a (int *) which compiles
> without warnings under slackware and solaris. But under red hat it warns
> that the parameter is supposed to be a (unsigned int *).
>
> I don't know what to do about this to have my code compile cleanly.
> Also which is more the up-to-date standard for recvfrom() ?
> Which way is it in glibc 2.1? Any suggestions?

You could probably wrap your variable definition in something like
#if __GLIBC__ >= 2
unsigned int *var;
#else
int *var
#endif

Maybe you have to #include <features.h> for this to work, but probably
not.

I guess the more recent recvfrom() format (the one in glibc 2.0.7) is the
one more likely to be used in glibc2.1.

-- 
Pontus Lidman, pontus@mathcore.com, Development & support manager
Scene: www.dc-s.com | MUD: tyme.envy.com 6969 | irc: irc.quakenet.eu.org
>>Those who do not understand Unix are condemned to reinvent it, poorly.<<
     All standard disclaimers apply. ---  Void where prohibited.

- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.rutgers.edu