diff options
Diffstat (limited to 'lib/libc')
35 files changed, 100 insertions, 33 deletions
diff --git a/lib/libc/alpha/net/byte_swap_2.S b/lib/libc/alpha/net/byte_swap_2.S index fab3c58..ebcbeda 100644 --- a/lib/libc/alpha/net/byte_swap_2.S +++ b/lib/libc/alpha/net/byte_swap_2.S @@ -25,12 +25,14 @@ * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. + * + * $FreeBSD$ */ #include <machine/asm.h> -#ifndef NAME -#define NAME byte_swap_2 +#if !defined(ALIAS) || !defined(NAME) +#error ALIAS or NAME not defined #endif /* @@ -38,6 +40,7 @@ * * Argument is an unsigned 2-byte integer (u_int16_t). */ +XLEAF(ALIAS, 1) LEAF(NAME, 1) /* a0 contains 0x0123 */ extbl a0, 0, t0 /* t0 = 0x 23 */ extbl a0, 1, t1 /* t1 = 0x 01 */ diff --git a/lib/libc/alpha/net/byte_swap_4.S b/lib/libc/alpha/net/byte_swap_4.S index 8dbb83c..ddfd1e9 100644 --- a/lib/libc/alpha/net/byte_swap_4.S +++ b/lib/libc/alpha/net/byte_swap_4.S @@ -25,12 +25,14 @@ * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. + * + * $FreeBSD$ */ #include <machine/asm.h> -#ifndef NAME -#define NAME byte_swap_4 +#if !defined(ALIAS) || !defined(NAME) +#error ALIAS or NAME not defined #endif /* @@ -38,6 +40,7 @@ * * Argument is an unsigned 4-byte integer (u_int32_t). */ +XLEAF(ALIAS, 1) LEAF(NAME, 1) /* a0 contains 0x01234567 */ extbl a0, 0, t0 /* t0 = 0x 67 */ extbl a0, 1, t1 /* t1 = 0x 45 */ diff --git a/lib/libc/alpha/net/htonl.S b/lib/libc/alpha/net/htonl.S index bacab1e..90d9441 100644 --- a/lib/libc/alpha/net/htonl.S +++ b/lib/libc/alpha/net/htonl.S @@ -25,8 +25,11 @@ * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. + * + * $FreeBSD$ */ -#define NAME htonl +#define ALIAS htonl +#define NAME __htonl #include "byte_swap_4.S" diff --git a/lib/libc/alpha/net/htons.S b/lib/libc/alpha/net/htons.S index fb08222..405d537 100644 --- a/lib/libc/alpha/net/htons.S +++ b/lib/libc/alpha/net/htons.S @@ -25,8 +25,11 @@ * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. + * + * $FreeBSD$ */ -#define NAME htons +#define ALIAS htons +#define NAME __htons #include "byte_swap_2.S" diff --git a/lib/libc/alpha/net/ntohl.S b/lib/libc/alpha/net/ntohl.S index b571647..54ea68d 100644 --- a/lib/libc/alpha/net/ntohl.S +++ b/lib/libc/alpha/net/ntohl.S @@ -25,8 +25,11 @@ * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. + * + * $FreeBSD$ */ -#define NAME ntohl +#define ALIAS ntohl +#define NAME __ntohl #include "byte_swap_4.S" diff --git a/lib/libc/alpha/net/ntohs.S b/lib/libc/alpha/net/ntohs.S index 6db9961..f841a7a8 100644 --- a/lib/libc/alpha/net/ntohs.S +++ b/lib/libc/alpha/net/ntohs.S @@ -25,8 +25,11 @@ * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. + * + * $FreeBSD$ */ -#define NAME ntohs +#define ALIAS ntohs +#define NAME __ntohs #include "byte_swap_2.S" diff --git a/lib/libc/amd64/net/htonl.S b/lib/libc/amd64/net/htonl.S index af3354f..6658b69 100644 --- a/lib/libc/amd64/net/htonl.S +++ b/lib/libc/amd64/net/htonl.S @@ -43,7 +43,9 @@ #include <machine/asm.h> -ENTRY(htonl) + .weak CNAME(htonl) + .set CNAME(htonl),CNAME(__htonl) +ENTRY(__htonl) movl 4(%esp),%eax xchgb %al,%ah roll $16,%eax diff --git a/lib/libc/amd64/net/htons.S b/lib/libc/amd64/net/htons.S index c78b108..c354eaa 100644 --- a/lib/libc/amd64/net/htons.S +++ b/lib/libc/amd64/net/htons.S @@ -43,7 +43,9 @@ #include <machine/asm.h> -ENTRY(htons) + .weak CNAME(htons) + .set CNAME(htons),CNAME(__htons) +ENTRY(__htons) movzwl 4(%esp),%eax xchgb %al,%ah ret diff --git a/lib/libc/amd64/net/ntohl.S b/lib/libc/amd64/net/ntohl.S index 3a2c202..46ff54e 100644 --- a/lib/libc/amd64/net/ntohl.S +++ b/lib/libc/amd64/net/ntohl.S @@ -43,7 +43,9 @@ #include <machine/asm.h> -ENTRY(ntohl) + .weak CNAME(ntohl) + .set CNAME(ntohl),CNAME(__ntohl) +ENTRY(__ntohl) movl 4(%esp),%eax xchgb %al,%ah roll $16,%eax diff --git a/lib/libc/amd64/net/ntohs.S b/lib/libc/amd64/net/ntohs.S index 110faf7..3f0a36a 100644 --- a/lib/libc/amd64/net/ntohs.S +++ b/lib/libc/amd64/net/ntohs.S @@ -43,7 +43,9 @@ #include <machine/asm.h> -ENTRY(ntohs) + .weak CNAME(ntohs) + .set CNAME(ntohs),CNAME(__ntohs) +ENTRY(__ntohs) movzwl 4(%esp),%eax xchgb %al,%ah ret diff --git a/lib/libc/i386/net/htonl.S b/lib/libc/i386/net/htonl.S index af3354f..6658b69 100644 --- a/lib/libc/i386/net/htonl.S +++ b/lib/libc/i386/net/htonl.S @@ -43,7 +43,9 @@ #include <machine/asm.h> -ENTRY(htonl) + .weak CNAME(htonl) + .set CNAME(htonl),CNAME(__htonl) +ENTRY(__htonl) movl 4(%esp),%eax xchgb %al,%ah roll $16,%eax diff --git a/lib/libc/i386/net/htons.S b/lib/libc/i386/net/htons.S index c78b108..c354eaa 100644 --- a/lib/libc/i386/net/htons.S +++ b/lib/libc/i386/net/htons.S @@ -43,7 +43,9 @@ #include <machine/asm.h> -ENTRY(htons) + .weak CNAME(htons) + .set CNAME(htons),CNAME(__htons) +ENTRY(__htons) movzwl 4(%esp),%eax xchgb %al,%ah ret diff --git a/lib/libc/i386/net/ntohl.S b/lib/libc/i386/net/ntohl.S index 3a2c202..46ff54e 100644 --- a/lib/libc/i386/net/ntohl.S +++ b/lib/libc/i386/net/ntohl.S @@ -43,7 +43,9 @@ #include <machine/asm.h> -ENTRY(ntohl) + .weak CNAME(ntohl) + .set CNAME(ntohl),CNAME(__ntohl) +ENTRY(__ntohl) movl 4(%esp),%eax xchgb %al,%ah roll $16,%eax diff --git a/lib/libc/i386/net/ntohs.S b/lib/libc/i386/net/ntohs.S index 110faf7..3f0a36a 100644 --- a/lib/libc/i386/net/ntohs.S +++ b/lib/libc/i386/net/ntohs.S @@ -43,7 +43,9 @@ #include <machine/asm.h> -ENTRY(ntohs) + .weak CNAME(ntohs) + .set CNAME(ntohs),CNAME(__ntohs) +ENTRY(__ntohs) movzwl 4(%esp),%eax xchgb %al,%ah ret diff --git a/lib/libc/ia64/net/byte_swap_2.S b/lib/libc/ia64/net/byte_swap_2.S index fbee3c8..19d0eef 100644 --- a/lib/libc/ia64/net/byte_swap_2.S +++ b/lib/libc/ia64/net/byte_swap_2.S @@ -30,8 +30,8 @@ #include <machine/asm.h> -#ifndef NAME -#define NAME byte_swap_2 +#if !defined(ALIAS) || !defined(NAME) +#error ALIAS or NAME not defined #endif /* @@ -39,6 +39,7 @@ * * Argument is an unsigned 2-byte integer (u_int16_t). */ +WEAK_ALIAS(ALIAS, NAME) ENTRY(NAME, 1) mux1 r16=in0,@rev ;; diff --git a/lib/libc/ia64/net/byte_swap_4.S b/lib/libc/ia64/net/byte_swap_4.S index d183644..71019ba 100644 --- a/lib/libc/ia64/net/byte_swap_4.S +++ b/lib/libc/ia64/net/byte_swap_4.S @@ -30,8 +30,8 @@ #include <machine/asm.h> -#ifndef NAME -#define NAME byte_swap_4 +#if !defined(ALIAS) || !defined(NAME) +#error ALIAS or NAME not defined #endif /* @@ -39,6 +39,7 @@ * * Argument is an unsigned 4-byte integer (u_int32_t). */ +WEAK_ALIAS(ALIAS, NAME) ENTRY(NAME, 1) mux1 r16=in0,@rev ;; diff --git a/lib/libc/ia64/net/htonl.S b/lib/libc/ia64/net/htonl.S index 20d86af..7a71a29 100644 --- a/lib/libc/ia64/net/htonl.S +++ b/lib/libc/ia64/net/htonl.S @@ -28,6 +28,7 @@ * rights to redistribute these changes. */ -#define NAME htonl +#define ALIAS htonl +#define NAME __htonl #include "byte_swap_4.S" diff --git a/lib/libc/ia64/net/htons.S b/lib/libc/ia64/net/htons.S index 5082d88..689b367 100644 --- a/lib/libc/ia64/net/htons.S +++ b/lib/libc/ia64/net/htons.S @@ -28,6 +28,7 @@ * rights to redistribute these changes. */ -#define NAME htons +#define ALIAS htons +#define NAME __htons #include "byte_swap_2.S" diff --git a/lib/libc/ia64/net/ntohl.S b/lib/libc/ia64/net/ntohl.S index 54299c4..9e2c612 100644 --- a/lib/libc/ia64/net/ntohl.S +++ b/lib/libc/ia64/net/ntohl.S @@ -28,6 +28,7 @@ * rights to redistribute these changes. */ -#define NAME ntohl +#define ALIAS ntohl +#define NAME __ntohl #include "byte_swap_4.S" diff --git a/lib/libc/ia64/net/ntohs.S b/lib/libc/ia64/net/ntohs.S index 1eec14b..16a884b 100644 --- a/lib/libc/ia64/net/ntohs.S +++ b/lib/libc/ia64/net/ntohs.S @@ -28,6 +28,7 @@ * rights to redistribute these changes. */ -#define NAME ntohs +#define ALIAS ntohs +#define NAME __ntohs #include "byte_swap_2.S" diff --git a/lib/libc/locale/rune.c b/lib/libc/locale/rune.c index f0a5490..a6b890d 100644 --- a/lib/libc/locale/rune.c +++ b/lib/libc/locale/rune.c @@ -41,6 +41,7 @@ static char sccsid[] = "@(#)rune.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include "namespace.h" +#include <arpa/inet.h> #include <rune.h> #include <stdio.h> #include <string.h> diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c index cd4449f..5ffb6d2 100644 --- a/lib/libc/net/getservent.c +++ b/lib/libc/net/getservent.c @@ -31,12 +31,18 @@ * SUCH DAMAGE. */ +#if 0 #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ +#endif 0 + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); #include <sys/types.h> #include <sys/socket.h> +#include <arpa/inet.h> #include <netdb.h> #include <stdio.h> #include <string.h> diff --git a/lib/libc/net/ns_addr.c b/lib/libc/net/ns_addr.c index 75449ed..e00f20d 100644 --- a/lib/libc/net/ns_addr.c +++ b/lib/libc/net/ns_addr.c @@ -41,6 +41,7 @@ static char sccsid[] = "@(#)ns_addr.c 8.1 (Berkeley) 6/7/93"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> +#include <arpa/inet.h> #include <netns/ns.h> #include <stdio.h> #include <string.h> diff --git a/lib/libc/net/ns_ntoa.c b/lib/libc/net/ns_ntoa.c index de5f305..6ba2caf 100644 --- a/lib/libc/net/ns_ntoa.c +++ b/lib/libc/net/ns_ntoa.c @@ -31,11 +31,17 @@ * SUCH DAMAGE. */ +#if 0 #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ns_ntoa.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ +#endif + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); #include <sys/param.h> +#include <arpa/inet.h> #include <netns/ns.h> #include <stdio.h> diff --git a/lib/libc/rpc/auth_des.c b/lib/libc/rpc/auth_des.c index e7aef64..6a7da3a 100644 --- a/lib/libc/rpc/auth_des.c +++ b/lib/libc/rpc/auth_des.c @@ -48,7 +48,6 @@ #include <rpc/auth_des.h> #include <rpc/clnt.h> #include <rpc/xdr.h> -#include <netinet/in.h> /* XXX: just to get htonl() and ntohl() */ #include <sys/socket.h> #undef NIS #include <rpcsvc/nis.h> diff --git a/lib/libc/rpc/clnt_dg.c b/lib/libc/rpc/clnt_dg.c index 59869bf..5ca88d3 100644 --- a/lib/libc/rpc/clnt_dg.c +++ b/lib/libc/rpc/clnt_dg.c @@ -52,6 +52,7 @@ static char sccsid[] = "@(#)clnt_dg.c 1.19 89/03/16 Copyr 1988 Sun Micro"; #include <sys/time.h> #include <sys/socket.h> #include <sys/ioctl.h> +#include <arpa/inet.h> #include <rpc/rpc.h> #include <errno.h> #include <stdlib.h> diff --git a/lib/libc/rpc/clnt_vc.c b/lib/libc/rpc/clnt_vc.c index d2d0178..b96822e 100644 --- a/lib/libc/rpc/clnt_vc.c +++ b/lib/libc/rpc/clnt_vc.c @@ -65,6 +65,7 @@ static char sccsid[] = "@(#)clnt_vc.c 1.19 89/03/16 Copyr 1988 Sun Micro"; #include <sys/un.h> #include <sys/uio.h> +#include <arpa/inet.h> #include <assert.h> #include <err.h> #include <errno.h> diff --git a/lib/libc/rpc/pmap_getmaps.c b/lib/libc/rpc/pmap_getmaps.c index 4c8397f..3fdc44f 100644 --- a/lib/libc/rpc/pmap_getmaps.c +++ b/lib/libc/rpc/pmap_getmaps.c @@ -49,6 +49,7 @@ static char *rcsid = "$FreeBSD$"; #include <sys/socket.h> #include <sys/ioctl.h> +#include <arpa/inet.h> #include <net/if.h> #include <assert.h> diff --git a/lib/libc/rpc/pmap_getport.c b/lib/libc/rpc/pmap_getport.c index ff75c9f..02946d3 100644 --- a/lib/libc/rpc/pmap_getport.c +++ b/lib/libc/rpc/pmap_getport.c @@ -47,6 +47,7 @@ static char *rcsid = "$FreeBSD$"; #include <sys/types.h> #include <sys/socket.h> +#include <arpa/inet.h> #include <net/if.h> #include <assert.h> diff --git a/lib/libc/sparc64/net/htonl.S b/lib/libc/sparc64/net/htonl.S index c479615..c3d10e5 100644 --- a/lib/libc/sparc64/net/htonl.S +++ b/lib/libc/sparc64/net/htonl.S @@ -53,7 +53,9 @@ #endif /* SYSLIBC_RCS and not lint */ /* netorder = htonl(hostorder) */ -ENTRY(htonl) + .weak CNAME(htonl) + .set CNAME(htonl),CNAME(__htonl) +ENTRY(__htonl) retl srl %o0, 0, %o0 /* zero extend -- or do we sign extend? */ -END(htonl) +END(__htonl) diff --git a/lib/libc/sparc64/net/htons.S b/lib/libc/sparc64/net/htons.S index 70cd0cc..6f1fa70 100644 --- a/lib/libc/sparc64/net/htons.S +++ b/lib/libc/sparc64/net/htons.S @@ -53,9 +53,11 @@ #endif /* SYSLIBC_RCS and not lint */ /* netorder = htons(hostorder) */ -ENTRY(htons) + .weak CNAME(htons) + .set CNAME(htons),CNAME(__htons) +ENTRY(__htons) sethi %hi(0xffff0000), %o1 signx %o1, %o1 retl andn %o0, %o1, %o0 -END(htons) +END(__htons) diff --git a/lib/libc/sparc64/net/ntohl.S b/lib/libc/sparc64/net/ntohl.S index 3ed47ee..4a54691 100644 --- a/lib/libc/sparc64/net/ntohl.S +++ b/lib/libc/sparc64/net/ntohl.S @@ -53,7 +53,9 @@ #endif /* SYSLIBC_RCS and not lint */ /* hostorder = ntohl(netorder) */ -ENTRY(ntohl) + .weak CNAME(ntohl) + .set CNAME(ntohl),CNAME(__ntohl) +ENTRY(__ntohl) retl signx %o0, %o0 -END(ntohl) +END(__ntohl) diff --git a/lib/libc/sparc64/net/ntohs.S b/lib/libc/sparc64/net/ntohs.S index f3a5e19..1b144a9 100644 --- a/lib/libc/sparc64/net/ntohs.S +++ b/lib/libc/sparc64/net/ntohs.S @@ -53,9 +53,11 @@ #endif /* SYSLIBC_RCS and not lint */ /* hostorder = ntohs(netorder) */ -ENTRY(ntohs) + .weak CNAME(ntohs) + .set CNAME(ntohs),CNAME(__ntohs) +ENTRY(__ntohs) sethi %hi(0xffff0000), %o1 signx %o1, %o1 retl andn %o0, %o1, %o0 -END(ntohs) +END(__ntohs) diff --git a/lib/libc/xdr/xdr_stdio.c b/lib/libc/xdr/xdr_stdio.c index c4328ec..e49cb44 100644 --- a/lib/libc/xdr/xdr_stdio.c +++ b/lib/libc/xdr/xdr_stdio.c @@ -49,6 +49,7 @@ static char *rcsid = "$FreeBSD$"; #include "namespace.h" #include <stdio.h> +#include <arpa/inet.h> #include <rpc/types.h> #include <rpc/xdr.h> #include "un-namespace.h" diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c index 0a4bc7e..9f9ffba 100644 --- a/lib/libc/yp/yplib.c +++ b/lib/libc/yp/yplib.c @@ -38,6 +38,7 @@ static char *rcsid = "$FreeBSD$"; #include <sys/socket.h> #include <sys/file.h> #include <sys/uio.h> +#include <arpa/inet.h> #include <errno.h> #include <stdio.h> #include <string.h> |