Subject: Re: inet_makeaddr(), u_long, _POSIX_SOURCE macro
To: None <a_grey_m@poczta.onet.pl>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-kern
Date: 01/05/2003 17:48:38
We can't change it to in_addr_t (that would be ABI change for
64bit archs, since in_addr_t is 32bit). But it would probably
be good to change the u_long to 'unsigned long' in the header.
Jaromir
a_grey_m@poczta.onet.pl wrote:
> hello
>=20
> I meet a problem with headers (I check it in NetBSD 1.5.3 & 1.6).
> When I do:
> /*foo.h*/
> #include=20
> #inclde=20
> void foo (void)
> {
> }
> /*end*/
> gcc -c -D_POSIX_SOURCE foo.c
>=20
> I have a problem with u_long because it is not defined. I Iooked at this =
headers and found that:
> /*arpa/inet.h*/
> ...
> struct in_addr inet_makeaddr (u_long, u_long);
> ...
>=20
> /*sys/types.h*/
> #if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
> typedef unsigned long u_long;
> ...
> #endif
>=20
> So when I -D_POSIX_SOURCE I dont have u_long
> But why??? I check in X/OPEN Networking Servies, issue 4 and issue 5.2 and
> there is
> struct in_addr inet_makeaddr (in_addr_t, in_addr_t)
> and in issue 6 there is not at all inet_makeaddr()
> I checked a body of inet_makeaddr() in cvs (cvsweb.netbsd.org) and there =
is a casting inside this function, u_long->in_addr. So now I want to ask if=
anyone know why in NetBSD (and even in 1.6) there are such definitions, it=
make impossilble to use _POS=
IX_SOURCE or _XOPEN_SOURCE in programs. I look lately on OpenBSD 3.2 and fo=
und the same situation on the same files but on diffrent functions and with=
u_char and u_int. So mayby during compilation that two definition can`t be=
used??? Any sugestion???
>=20
> regards
> MariuszW
>=20
>=20
>=20
>=20
> --------------r-e-k-l-a-m-a-----------------
>=20
> Super tanie kwatery narciarskie.
> Od 300 z=B3/osoba/tydzie=F1
> http://wycieczki.onet.pl
--=20
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.org/
-=3D- We should be mindful of the potential goal, but as the tantric -=
=3D-
-=3D- Buddhist masters say, ``You may notice during meditation that you -=
=3D-
-=3D- sometimes levitate or glow. Do not let this distract you.'' -=
=3D-