diff options
Diffstat (limited to 'lib/libc/inet/inet_netof.c')
-rw-r--r-- | lib/libc/inet/inet_netof.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/libc/inet/inet_netof.c b/lib/libc/inet/inet_netof.c index e887530..e993459 100644 --- a/lib/libc/inet/inet_netof.c +++ b/lib/libc/inet/inet_netof.c @@ -34,6 +34,8 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)inet_netof.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); #include "port_before.h" @@ -47,11 +49,11 @@ static const char sccsid[] = "@(#)inet_netof.c 8.1 (Berkeley) 6/4/93"; * Return the network number from an internet * address; handles class a/b/c network #'s. */ -u_long +in_addr_t inet_netof(in) struct in_addr in; { - register u_long i = ntohl(in.s_addr); + in_addr_t i = ntohl(in.s_addr); if (IN_CLASSA(i)) return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT); @@ -60,3 +62,10 @@ inet_netof(in) else return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT); } + +/* + * Weak aliases for applications that use certain private entry points, + * and fail to include <arpa/inet.h>. + */ +#undef inet_netof +__weak_reference(__inet_netof, inet_netof); |