Re: recvfrom() params discrepancy

Pontus Lidman (
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;
int *var

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

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,, Development & support manager
Scene: | MUD: 6969 | irc:
>>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