summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/asr/getaddrinfo.c3
-rw-r--r--lib/libc/asr/gethostnamadr.c4
-rw-r--r--lib/libc/asr/getnameinfo.c3
-rw-r--r--lib/libc/asr/getrrsetbyname.c3
-rw-r--r--lib/libc/hidden/netdb.h42
-rw-r--r--lib/libc/net/freeaddrinfo.c3
-rw-r--r--lib/libc/net/gai_strerror.c3
-rw-r--r--lib/libc/net/getproto.c3
-rw-r--r--lib/libc/net/getprotoent.c5
-rw-r--r--lib/libc/net/getprotoname.c4
-rw-r--r--lib/libc/net/getservbyname.c4
-rw-r--r--lib/libc/net/getservbyport.c3
-rw-r--r--lib/libc/net/getservent.c5
-rw-r--r--lib/libc/net/herror.c3
14 files changed, 74 insertions, 14 deletions
diff --git a/lib/libc/asr/getaddrinfo.c b/lib/libc/asr/getaddrinfo.c
index f5080572163..d988b9ae16d 100644
--- a/lib/libc/asr/getaddrinfo.c
+++ b/lib/libc/asr/getaddrinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getaddrinfo.c,v 1.5 2014/03/26 18:13:15 eric Exp $ */
+/* $OpenBSD: getaddrinfo.c,v 1.6 2015/09/14 07:38:37 guenther Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -51,3 +51,4 @@ getaddrinfo(const char *hostname, const char *servname,
return (ar.ar_gai_errno);
}
+DEF_WEAK(getaddrinfo);
diff --git a/lib/libc/asr/gethostnamadr.c b/lib/libc/asr/gethostnamadr.c
index a0aba01d3de..2fce46b37fd 100644
--- a/lib/libc/asr/gethostnamadr.c
+++ b/lib/libc/asr/gethostnamadr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gethostnamadr.c,v 1.12 2015/01/16 16:48:51 deraadt Exp $ */
+/* $OpenBSD: gethostnamadr.c,v 1.13 2015/09/14 07:38:37 guenther Exp $ */
/*
* Copyright (c) 2012,2013 Eric Faurot <eric@openbsd.org>
*
@@ -142,6 +142,7 @@ gethostbyname(const char *name)
return gethostbyname2(name, AF_INET);
}
+DEF_WEAK(gethostbyname);
struct hostent *
gethostbyname2(const char *name, int af)
@@ -162,6 +163,7 @@ gethostbyname2(const char *name, int af)
return (&_hostent);
}
+DEF_WEAK(gethostbyname2);
struct hostent *
gethostbyaddr(const void *addr, socklen_t len, int af)
diff --git a/lib/libc/asr/getnameinfo.c b/lib/libc/asr/getnameinfo.c
index 49819b027d4..4beb30d906b 100644
--- a/lib/libc/asr/getnameinfo.c
+++ b/lib/libc/asr/getnameinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnameinfo.c,v 1.6 2015/05/25 19:16:08 eric Exp $ */
+/* $OpenBSD: getnameinfo.c,v 1.7 2015/09/14 07:38:37 guenther Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -199,3 +199,4 @@ getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host,
return (ar.ar_gai_errno);
}
+DEF_WEAK(getnameinfo);
diff --git a/lib/libc/asr/getrrsetbyname.c b/lib/libc/asr/getrrsetbyname.c
index 424725ec30b..24df2c8bfa0 100644
--- a/lib/libc/asr/getrrsetbyname.c
+++ b/lib/libc/asr/getrrsetbyname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getrrsetbyname.c,v 1.5 2014/03/26 18:13:15 eric Exp $ */
+/* $OpenBSD: getrrsetbyname.c,v 1.6 2015/09/14 07:38:37 guenther Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -80,3 +80,4 @@ freerrset(struct rrsetinfo *rrset)
free(rrset->rri_name);
free(rrset);
}
+DEF_WEAK(freerrset);
diff --git a/lib/libc/hidden/netdb.h b/lib/libc/hidden/netdb.h
index 0f53c409ac4..425847196fd 100644
--- a/lib/libc/hidden/netdb.h
+++ b/lib/libc/hidden/netdb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: netdb.h,v 1.1 2015/09/11 08:48:33 deraadt Exp $ */
+/* $OpenBSD: netdb.h,v 1.2 2015/09/14 07:38:38 guenther Exp $ */
/*
* Copyright (c) 2015 Theo de Raadt <deraadt@openbsd.org>
*
@@ -26,4 +26,44 @@ extern struct protoent_data _protoent_data;
extern struct servent_data _servent_data;
__END_HIDDEN_DECLS
+PROTO_DEPRECATED(endhostent);
+PROTO_DEPRECATED(endnetent);
+PROTO_DEPRECATED(endprotoent);
+PROTO_NORMAL(endprotoent_r);
+PROTO_DEPRECATED(endservent);
+PROTO_NORMAL(endservent_r);
+PROTO_NORMAL(freeaddrinfo);
+PROTO_NORMAL(freerrset);
+PROTO_NORMAL(gai_strerror);
+PROTO_NORMAL(getaddrinfo);
+PROTO_DEPRECATED(gethostbyaddr);
+PROTO_NORMAL(gethostbyname);
+PROTO_NORMAL(gethostbyname2);
+PROTO_DEPRECATED(gethostent);
+PROTO_NORMAL(getnameinfo);
+PROTO_DEPRECATED(getnetbyaddr);
+PROTO_DEPRECATED(getnetbyname);
+PROTO_DEPRECATED(getnetent);
+PROTO_NORMAL(getprotobyname);
+PROTO_NORMAL(getprotobyname_r);
+PROTO_DEPRECATED(getprotobynumber);
+PROTO_NORMAL(getprotobynumber_r);
+PROTO_DEPRECATED(getprotoent);
+PROTO_NORMAL(getprotoent_r);
+PROTO_DEPRECATED(getrrsetbyname);
+PROTO_NORMAL(getservbyname);
+PROTO_NORMAL(getservbyname_r);
+PROTO_DEPRECATED(getservbyport);
+PROTO_NORMAL(getservbyport_r);
+PROTO_DEPRECATED(getservent);
+PROTO_NORMAL(getservent_r);
+PROTO_DEPRECATED(herror);
+PROTO_NORMAL(hstrerror);
+PROTO_DEPRECATED(sethostent);
+PROTO_DEPRECATED(setnetent);
+PROTO_DEPRECATED(setprotoent);
+PROTO_NORMAL(setprotoent_r);
+PROTO_DEPRECATED(setservent);
+PROTO_NORMAL(setservent_r);
+
#endif /* !_LIBC_NETDB_H */
diff --git a/lib/libc/net/freeaddrinfo.c b/lib/libc/net/freeaddrinfo.c
index 58702d0b187..5efb97db921 100644
--- a/lib/libc/net/freeaddrinfo.c
+++ b/lib/libc/net/freeaddrinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: freeaddrinfo.c,v 1.6 2005/03/25 13:24:11 otto Exp $ */
+/* $OpenBSD: freeaddrinfo.c,v 1.7 2015/09/14 07:38:38 guenther Exp $ */
/*
* Copyright (c) 1996, 1997, 1998, 1999, Craig Metz, All rights reserved.
@@ -48,3 +48,4 @@ freeaddrinfo(struct addrinfo *ai)
free((void *)p);
} while (ai);
}
+DEF_WEAK(freeaddrinfo);
diff --git a/lib/libc/net/gai_strerror.c b/lib/libc/net/gai_strerror.c
index f4126413f8b..1e9b585029c 100644
--- a/lib/libc/net/gai_strerror.c
+++ b/lib/libc/net/gai_strerror.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gai_strerror.c,v 1.7 2009/06/02 16:47:50 jasper Exp $ */
+/* $OpenBSD: gai_strerror.c,v 1.8 2015/09/14 07:38:38 guenther Exp $ */
/*
* Copyright (c) 1997-1999, Craig Metz, All rights reserved.
@@ -76,3 +76,4 @@ gai_strerror(int errnum)
return "unknown/invalid error";
}
}
+DEF_WEAK(gai_strerror);
diff --git a/lib/libc/net/getproto.c b/lib/libc/net/getproto.c
index 07fa33288d3..8e080679d0e 100644
--- a/lib/libc/net/getproto.c
+++ b/lib/libc/net/getproto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getproto.c,v 1.7 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: getproto.c,v 1.8 2015/09/14 07:38:38 guenther Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -46,6 +46,7 @@ getprotobynumber_r(int num, struct protoent *pe, struct protoent_data *pd)
}
return (error);
}
+DEF_WEAK(getprotobynumber_r);
struct protoent *
getprotobynumber(int num)
diff --git a/lib/libc/net/getprotoent.c b/lib/libc/net/getprotoent.c
index 7431566f856..a218863d07c 100644
--- a/lib/libc/net/getprotoent.c
+++ b/lib/libc/net/getprotoent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getprotoent.c,v 1.12 2014/10/11 03:12:13 doug Exp $ */
+/* $OpenBSD: getprotoent.c,v 1.13 2015/09/14 07:38:38 guenther Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -47,6 +47,7 @@ setprotoent_r(int f, struct protoent_data *pd)
rewind(pd->fp);
pd->stayopen |= f;
}
+DEF_WEAK(setprotoent_r);
void
endprotoent_r(struct protoent_data *pd)
@@ -62,6 +63,7 @@ endprotoent_r(struct protoent_data *pd)
pd->line = NULL;
pd->stayopen = 0;
}
+DEF_WEAK(endprotoent_r);
int
getprotoent_r(struct protoent *pe, struct protoent_data *pd)
@@ -140,6 +142,7 @@ again:
*q = NULL;
return (0);
}
+DEF_WEAK(getprotoent_r);
struct protoent_data _protoent_data; /* shared with getproto{,name}.c */
diff --git a/lib/libc/net/getprotoname.c b/lib/libc/net/getprotoname.c
index 749b6b3f13d..f6ed4c49b1a 100644
--- a/lib/libc/net/getprotoname.c
+++ b/lib/libc/net/getprotoname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getprotoname.c,v 1.7 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: getprotoname.c,v 1.8 2015/09/14 07:38:38 guenther Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -54,6 +54,7 @@ found:
}
return (error);
}
+DEF_WEAK(getprotobyname_r);
struct protoent *
getprotobyname(const char *name)
@@ -65,3 +66,4 @@ getprotobyname(const char *name)
return (NULL);
return (&proto);
}
+DEF_WEAK(getprotobyname);
diff --git a/lib/libc/net/getservbyname.c b/lib/libc/net/getservbyname.c
index beb8943af6b..80c7e62a411 100644
--- a/lib/libc/net/getservbyname.c
+++ b/lib/libc/net/getservbyname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getservbyname.c,v 1.10 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: getservbyname.c,v 1.11 2015/09/14 07:38:38 guenther Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -57,6 +57,7 @@ gotname:
}
return (error);
}
+DEF_WEAK(getservbyname_r);
struct servent *
getservbyname(const char *name, const char *proto)
@@ -68,3 +69,4 @@ getservbyname(const char *name, const char *proto)
return (NULL);
return (&serv);
}
+DEF_WEAK(getservbyname);
diff --git a/lib/libc/net/getservbyport.c b/lib/libc/net/getservbyport.c
index 46679ba3665..3584fbea3a6 100644
--- a/lib/libc/net/getservbyport.c
+++ b/lib/libc/net/getservbyport.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getservbyport.c,v 1.7 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: getservbyport.c,v 1.8 2015/09/14 07:38:38 guenther Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -51,6 +51,7 @@ getservbyport_r(int port, const char *proto, struct servent *se,
}
return (error);
}
+DEF_WEAK(getservbyport_r);
struct servent *
getservbyport(int port, const char *proto)
diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c
index dc43da0a8b5..220a5851ce3 100644
--- a/lib/libc/net/getservent.c
+++ b/lib/libc/net/getservent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getservent.c,v 1.14 2014/10/11 04:22:03 doug Exp $ */
+/* $OpenBSD: getservent.c,v 1.15 2015/09/14 07:38:38 guenther Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -47,6 +47,7 @@ setservent_r(int f, struct servent_data *sd)
rewind(sd->fp);
sd->stayopen |= f;
}
+DEF_WEAK(setservent_r);
void
endservent_r(struct servent_data *sd)
@@ -62,6 +63,7 @@ endservent_r(struct servent_data *sd)
sd->line = NULL;
sd->stayopen = 0;
}
+DEF_WEAK(endservent_r);
int
getservent_r(struct servent *se, struct servent_data *sd)
@@ -142,6 +144,7 @@ again:
*q = NULL;
return (0);
}
+DEF_WEAK(getservent_r);
struct servent_data _servent_data; /* shared with getservby{name,port}.c */
diff --git a/lib/libc/net/herror.c b/lib/libc/net/herror.c
index 8dee0cc382e..356c85fa1de 100644
--- a/lib/libc/net/herror.c
+++ b/lib/libc/net/herror.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: herror.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */
+/* $OpenBSD: herror.c,v 1.10 2015/09/14 07:38:38 guenther Exp $ */
/*
* ++Copyright++ 1987, 1993
@@ -103,3 +103,4 @@ hstrerror(int err)
return (h_errlist[err]);
return ("Unknown resolver error");
}
+DEF_WEAK(hstrerror);