diff --git a/include/netdb.h b/include/netdb.h index 0a201770f970..d5da81e45661 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -1,4 +1,4 @@ -/* $NetBSD: netdb.h,v 1.50 2005/03/21 13:30:50 kleink Exp $ */ +/* $NetBSD: netdb.h,v 1.51 2005/04/18 19:39:45 kleink Exp $ */ /* * Copyright (c) 1980, 1983, 1988, 1993 @@ -335,46 +335,6 @@ void freeaddrinfo(struct addrinfo *); const char *gai_strerror(int); #endif void setservent(int); - -#if defined(_NETBSD_SOURCE) && defined(_LIBC) - -struct protoent_data { - FILE *fp; - struct protoent proto; - char **aliases; - size_t maxaliases; - int stayopen; - char *line; - void *dummy; -}; - -struct protoent *getprotoent_r(struct protoent *, struct protoent_data *); -struct protoent *getprotobyname_r(const char *, - struct protoent *, struct protoent_data *); -struct protoent *getprotobynumber_r(int, - struct protoent *, struct protoent_data *); -void setprotoent_r(int, struct protoent_data *); -void endprotoent_r(struct protoent_data *); - -struct servent_data { - FILE *fp; - struct servent serv; - char **aliases; - size_t maxaliases; - int stayopen; - char *line; - void *dummy; -}; - -struct servent *getservent_r(struct servent *, struct servent_data *); -struct servent *getservbyname_r(const char *, const char *, - struct servent *, struct servent_data *); -struct servent *getservbyport_r(int, const char *, - struct servent *, struct servent_data *); -void setservent_r(int, struct servent_data *); -void endservent_r(struct servent_data *); - -#endif /* _NETBSD_SOURCE && _LIBC */ __END_DECLS #endif /* !_NETDB_H_ */ diff --git a/lib/libc/net/getprotobyname.c b/lib/libc/net/getprotobyname.c index b5bbcfec5432..a14c1b4af4ca 100644 --- a/lib/libc/net/getprotobyname.c +++ b/lib/libc/net/getprotobyname.c @@ -1,4 +1,4 @@ -/* $NetBSD: getprotobyname.c,v 1.2 2005/01/07 22:22:49 mycroft Exp $ */ +/* $NetBSD: getprotobyname.c,v 1.3 2005/04/18 19:39:45 kleink Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getprotobyname.c,v 1.2 2005/01/07 22:22:49 mycroft Exp $"); +__RCSID("$NetBSD: getprotobyname.c,v 1.3 2005/04/18 19:39:45 kleink Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -45,6 +45,8 @@ __RCSID("$NetBSD: getprotobyname.c,v 1.2 2005/01/07 22:22:49 mycroft Exp $"); #include +#include "protoent.h" + #ifdef __weak_alias __weak_alias(getprotobyname,_getprotobyname) #endif diff --git a/lib/libc/net/getprotobyname_r.c b/lib/libc/net/getprotobyname_r.c index fc66f4835386..3b621e0ef7fc 100644 --- a/lib/libc/net/getprotobyname_r.c +++ b/lib/libc/net/getprotobyname_r.c @@ -1,4 +1,4 @@ -/* $NetBSD: getprotobyname_r.c,v 1.2 2004/03/04 02:30:41 enami Exp $ */ +/* $NetBSD: getprotobyname_r.c,v 1.3 2005/04/18 19:39:45 kleink Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getprotoname.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: getprotobyname_r.c,v 1.2 2004/03/04 02:30:41 enami Exp $"); +__RCSID("$NetBSD: getprotobyname_r.c,v 1.3 2005/04/18 19:39:45 kleink Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -44,6 +44,8 @@ __RCSID("$NetBSD: getprotobyname_r.c,v 1.2 2004/03/04 02:30:41 enami Exp $"); #include #include +#include "protoent.h" + #ifdef __weak_alias __weak_alias(getprotobyname_r,_getprotobyname_r) #endif diff --git a/lib/libc/net/getprotobynumber.c b/lib/libc/net/getprotobynumber.c index 9acaed6019c0..8c5b82f83b55 100644 --- a/lib/libc/net/getprotobynumber.c +++ b/lib/libc/net/getprotobynumber.c @@ -1,4 +1,4 @@ -/* $NetBSD: getprotobynumber.c,v 1.2 2005/01/07 22:22:49 mycroft Exp $ */ +/* $NetBSD: getprotobynumber.c,v 1.3 2005/04/18 19:39:45 kleink Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getprotobynumber.c,v 1.2 2005/01/07 22:22:49 mycroft Exp $"); +__RCSID("$NetBSD: getprotobynumber.c,v 1.3 2005/04/18 19:39:45 kleink Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -46,6 +46,8 @@ __RCSID("$NetBSD: getprotobynumber.c,v 1.2 2005/01/07 22:22:49 mycroft Exp $"); #include +#include "protoent.h" + #ifdef __weak_alias __weak_alias(getprotobynumber,_getprotobynumber) #endif diff --git a/lib/libc/net/getprotobynumber_r.c b/lib/libc/net/getprotobynumber_r.c index 5003eb8e32a9..e1cb4f1eff47 100644 --- a/lib/libc/net/getprotobynumber_r.c +++ b/lib/libc/net/getprotobynumber_r.c @@ -1,4 +1,4 @@ -/* $NetBSD: getprotobynumber_r.c,v 1.2 2004/03/04 02:30:41 enami Exp $ */ +/* $NetBSD: getprotobynumber_r.c,v 1.3 2005/04/18 19:39:45 kleink Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getproto.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: getprotobynumber_r.c,v 1.2 2004/03/04 02:30:41 enami Exp $"); +__RCSID("$NetBSD: getprotobynumber_r.c,v 1.3 2005/04/18 19:39:45 kleink Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -42,6 +42,8 @@ __RCSID("$NetBSD: getprotobynumber_r.c,v 1.2 2004/03/04 02:30:41 enami Exp $"); #include #include +#include "protoent.h" + #ifdef __weak_alias __weak_alias(getprotobynumber_r,_getprotobynumber_r) #endif diff --git a/lib/libc/net/getprotoent.c b/lib/libc/net/getprotoent.c index 456be2cc3d6f..6b28a6a518f8 100644 --- a/lib/libc/net/getprotoent.c +++ b/lib/libc/net/getprotoent.c @@ -1,4 +1,4 @@ -/* $NetBSD: getprotoent.c,v 1.10 2005/01/07 22:22:49 mycroft Exp $ */ +/* $NetBSD: getprotoent.c,v 1.11 2005/04/18 19:39:45 kleink Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getprotoent.c,v 1.10 2005/01/07 22:22:49 mycroft Exp $"); +__RCSID("$NetBSD: getprotoent.c,v 1.11 2005/04/18 19:39:45 kleink Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -46,6 +46,8 @@ __RCSID("$NetBSD: getprotoent.c,v 1.10 2005/01/07 22:22:49 mycroft Exp $"); #include +#include "protoent.h" + #ifdef __weak_alias __weak_alias(endprotoent,_endprotoent) __weak_alias(getprotoent,_getprotoent) diff --git a/lib/libc/net/getprotoent_r.c b/lib/libc/net/getprotoent_r.c index 402f398c572d..01b0891c9741 100644 --- a/lib/libc/net/getprotoent_r.c +++ b/lib/libc/net/getprotoent_r.c @@ -1,4 +1,4 @@ -/* $NetBSD: getprotoent_r.c,v 1.4 2004/02/25 06:28:10 taca Exp $ */ +/* $NetBSD: getprotoent_r.c,v 1.5 2005/04/18 19:39:45 kleink Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getprotoent.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: getprotoent_r.c,v 1.4 2004/02/25 06:28:10 taca Exp $"); +__RCSID("$NetBSD: getprotoent_r.c,v 1.5 2005/04/18 19:39:45 kleink Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -45,6 +45,8 @@ __RCSID("$NetBSD: getprotoent_r.c,v 1.4 2004/02/25 06:28:10 taca Exp $"); #include #include +#include "protoent.h" + #ifdef __weak_alias __weak_alias(endprotoent_r,_endprotoent_r) __weak_alias(getprotoent_r,_getprotoent_r) diff --git a/lib/libc/net/getservbyname.c b/lib/libc/net/getservbyname.c index dcb23a33be53..44b0865a6577 100644 --- a/lib/libc/net/getservbyname.c +++ b/lib/libc/net/getservbyname.c @@ -1,4 +1,4 @@ -/* $NetBSD: getservbyname.c,v 1.12 2005/01/07 22:22:49 mycroft Exp $ */ +/* $NetBSD: getservbyname.c,v 1.13 2005/04/18 19:39:45 kleink Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getservbyname.c,v 1.12 2005/01/07 22:22:49 mycroft Exp $"); +__RCSID("$NetBSD: getservbyname.c,v 1.13 2005/04/18 19:39:45 kleink Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -45,6 +45,8 @@ __RCSID("$NetBSD: getservbyname.c,v 1.12 2005/01/07 22:22:49 mycroft Exp $"); #include +#include "servent.h" + #ifdef __weak_alias __weak_alias(getservbyname,_getservbyname) #endif diff --git a/lib/libc/net/getservbyname_r.c b/lib/libc/net/getservbyname_r.c index 462610c0479f..c8d2e8524cd8 100644 --- a/lib/libc/net/getservbyname_r.c +++ b/lib/libc/net/getservbyname_r.c @@ -1,4 +1,4 @@ -/* $NetBSD: getservbyname_r.c,v 1.2 2004/03/04 02:30:41 enami Exp $ */ +/* $NetBSD: getservbyname_r.c,v 1.3 2005/04/18 19:39:45 kleink Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getservbyname.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: getservbyname_r.c,v 1.2 2004/03/04 02:30:41 enami Exp $"); +__RCSID("$NetBSD: getservbyname_r.c,v 1.3 2005/04/18 19:39:45 kleink Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -43,6 +43,8 @@ __RCSID("$NetBSD: getservbyname_r.c,v 1.2 2004/03/04 02:30:41 enami Exp $"); #include #include +#include "servent.h" + #ifdef __weak_alias __weak_alias(getservbyname_r,_getservbyname_r) #endif diff --git a/lib/libc/net/getservbyport.c b/lib/libc/net/getservbyport.c index 1c7424e8f2c5..f69f0589379e 100644 --- a/lib/libc/net/getservbyport.c +++ b/lib/libc/net/getservbyport.c @@ -1,4 +1,4 @@ -/* $NetBSD: getservbyport.c,v 1.10 2005/01/07 22:22:49 mycroft Exp $ */ +/* $NetBSD: getservbyport.c,v 1.11 2005/04/18 19:39:45 kleink Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getservbyport.c,v 1.10 2005/01/07 22:22:49 mycroft Exp $"); +__RCSID("$NetBSD: getservbyport.c,v 1.11 2005/04/18 19:39:45 kleink Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -46,6 +46,8 @@ __RCSID("$NetBSD: getservbyport.c,v 1.10 2005/01/07 22:22:49 mycroft Exp $"); #include +#include "servent.h" + #ifdef __weak_alias __weak_alias(getservbyport,_getservbyport) #endif diff --git a/lib/libc/net/getservbyport_r.c b/lib/libc/net/getservbyport_r.c index 007401e465a8..7547345eb069 100644 --- a/lib/libc/net/getservbyport_r.c +++ b/lib/libc/net/getservbyport_r.c @@ -1,4 +1,4 @@ -/* $NetBSD: getservbyport_r.c,v 1.2 2004/03/04 02:30:41 enami Exp $ */ +/* $NetBSD: getservbyport_r.c,v 1.3 2005/04/18 19:39:45 kleink Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getservbyport.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: getservbyport_r.c,v 1.2 2004/03/04 02:30:41 enami Exp $"); +__RCSID("$NetBSD: getservbyport_r.c,v 1.3 2005/04/18 19:39:45 kleink Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -42,6 +42,8 @@ __RCSID("$NetBSD: getservbyport_r.c,v 1.2 2004/03/04 02:30:41 enami Exp $"); #include #include +#include "servent.h" + #ifdef __weak_alias __weak_alias(getservbyport_r,_getservbyport_r) #endif diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c index 4bca0c092cde..9d96656da8ba 100644 --- a/lib/libc/net/getservent.c +++ b/lib/libc/net/getservent.c @@ -1,4 +1,4 @@ -/* $NetBSD: getservent.c,v 1.10 2005/01/07 22:22:49 mycroft Exp $ */ +/* $NetBSD: getservent.c,v 1.11 2005/04/18 19:39:45 kleink Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getservent.c,v 1.10 2005/01/07 22:22:49 mycroft Exp $"); +__RCSID("$NetBSD: getservent.c,v 1.11 2005/04/18 19:39:45 kleink Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -46,6 +46,8 @@ __RCSID("$NetBSD: getservent.c,v 1.10 2005/01/07 22:22:49 mycroft Exp $"); #include +#include "servent.h" + #ifdef __weak_alias __weak_alias(endservent,_endservent) __weak_alias(getservent,_getservent) diff --git a/lib/libc/net/getservent_r.c b/lib/libc/net/getservent_r.c index e4e6111212a6..153646fdc35f 100644 --- a/lib/libc/net/getservent_r.c +++ b/lib/libc/net/getservent_r.c @@ -1,4 +1,4 @@ -/* $NetBSD: getservent_r.c,v 1.4 2004/02/25 06:28:10 taca Exp $ */ +/* $NetBSD: getservent_r.c,v 1.5 2005/04/18 19:39:45 kleink Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: getservent_r.c,v 1.4 2004/02/25 06:28:10 taca Exp $"); +__RCSID("$NetBSD: getservent_r.c,v 1.5 2005/04/18 19:39:45 kleink Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -45,6 +45,8 @@ __RCSID("$NetBSD: getservent_r.c,v 1.4 2004/02/25 06:28:10 taca Exp $"); #include #include +#include "servent.h" + #ifdef __weak_alias __weak_alias(endservent_r,_endservent_r) __weak_alias(getservent_r,_getservent_r) diff --git a/lib/libc/net/protoent.h b/lib/libc/net/protoent.h new file mode 100644 index 000000000000..08e3088e625d --- /dev/null +++ b/lib/libc/net/protoent.h @@ -0,0 +1,57 @@ +/* $NetBSD: protoent.h,v 1.1 2005/04/18 19:39:45 kleink Exp $ */ + +/*- + * Copyright (c) 2004 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +struct protoent_data { + FILE *fp; + struct protoent proto; + char **aliases; + size_t maxaliases; + int stayopen; + char *line; + void *dummy; +}; + +struct protoent *getprotoent_r(struct protoent *, struct protoent_data *); +struct protoent *getprotobyname_r(const char *, + struct protoent *, struct protoent_data *); +struct protoent *getprotobynumber_r(int, + struct protoent *, struct protoent_data *); +void setprotoent_r(int, struct protoent_data *); +void endprotoent_r(struct protoent_data *); diff --git a/lib/libc/net/servent.h b/lib/libc/net/servent.h new file mode 100644 index 000000000000..7f508e89f89e --- /dev/null +++ b/lib/libc/net/servent.h @@ -0,0 +1,57 @@ +/* $NetBSD: servent.h,v 1.1 2005/04/18 19:39:45 kleink Exp $ */ + +/*- + * Copyright (c) 2004 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +struct servent_data { + FILE *fp; + struct servent serv; + char **aliases; + size_t maxaliases; + int stayopen; + char *line; + void *dummy; +}; + +struct servent *getservent_r(struct servent *, struct servent_data *); +struct servent *getservbyname_r(const char *, const char *, + struct servent *, struct servent_data *); +struct servent *getservbyport_r(int, const char *, + struct servent *, struct servent_data *); +void setservent_r(int, struct servent_data *); +void endservent_r(struct servent_data *);