summaryrefslogtreecommitdiff
path: root/lib/libc/asr
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-09-14 11:52:50 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-09-14 11:52:50 +0000
commit9927002969391fa5c73b54aef874f79df198cd1f (patch)
treec0bb536601b4d907a154b105bd6be75c6a0a5f62 /lib/libc/asr
parentef2c1ed4d53bc2ddf7c4eafc7eb751f9488a67ea (diff)
Wrap <asr.h> so internal calls go direct and all the symbols are weak
Diffstat (limited to 'lib/libc/asr')
-rw-r--r--lib/libc/asr/asr.c4
-rw-r--r--lib/libc/asr/getaddrinfo_async.c3
-rw-r--r--lib/libc/asr/gethostnamadr_async.c5
-rw-r--r--lib/libc/asr/getnameinfo_async.c3
-rw-r--r--lib/libc/asr/getnetnamadr_async.c4
-rw-r--r--lib/libc/asr/getrrsetbyname_async.c5
-rw-r--r--lib/libc/asr/res_search_async.c3
-rw-r--r--lib/libc/asr/res_send_async.c4
8 files changed, 22 insertions, 9 deletions
diff --git a/lib/libc/asr/asr.c b/lib/libc/asr/asr.c
index 8c3f15e8f0c..6f767d27560 100644
--- a/lib/libc/asr/asr.c
+++ b/lib/libc/asr/asr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asr.c,v 1.40 2015/09/09 15:49:34 deraadt Exp $ */
+/* $OpenBSD: asr.c,v 1.41 2015/09/14 11:52:49 guenther Exp $ */
/*
* Copyright (c) 2010-2012 Eric Faurot <eric@openbsd.org>
*
@@ -211,6 +211,7 @@ asr_run(struct asr_query *as, struct asr_result *ar)
return (r);
}
+DEF_WEAK(asr_run);
/*
* Same as above, but run in a loop that handles the fd conditions result.
@@ -238,6 +239,7 @@ asr_run_sync(struct asr_query *as, struct asr_result *ar)
return (r);
}
+DEF_WEAK(asr_run_sync);
/*
* Create a new async request of the given "type" on the async context "ac".
diff --git a/lib/libc/asr/getaddrinfo_async.c b/lib/libc/asr/getaddrinfo_async.c
index bccf26123a3..19dd4ba0c90 100644
--- a/lib/libc/asr/getaddrinfo_async.c
+++ b/lib/libc/asr/getaddrinfo_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getaddrinfo_async.c,v 1.42 2015/09/09 15:49:34 deraadt Exp $ */
+/* $OpenBSD: getaddrinfo_async.c,v 1.43 2015/09/14 11:52:49 guenther Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -118,6 +118,7 @@ getaddrinfo_async(const char *hostname, const char *servname,
_asr_ctx_unref(ac);
return (NULL);
}
+DEF_WEAK(getaddrinfo_async);
static int
getaddrinfo_async_run(struct asr_query *as, struct asr_result *ar)
diff --git a/lib/libc/asr/gethostnamadr_async.c b/lib/libc/asr/gethostnamadr_async.c
index bf098e351d4..6f82d0335c2 100644
--- a/lib/libc/asr/gethostnamadr_async.c
+++ b/lib/libc/asr/gethostnamadr_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gethostnamadr_async.c,v 1.38 2015/09/09 15:49:34 deraadt Exp $ */
+/* $OpenBSD: gethostnamadr_async.c,v 1.39 2015/09/14 11:52:49 guenther Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -71,6 +71,7 @@ gethostbyname_async(const char *name, void *asr)
{
return gethostbyname2_async(name, AF_INET, asr);
}
+DEF_WEAK(gethostbyname_async);
struct asr_query *
gethostbyname2_async(const char *name, int af, void *asr)
@@ -107,6 +108,7 @@ gethostbyname2_async(const char *name, int af, void *asr)
_asr_ctx_unref(ac);
return (NULL);
}
+DEF_WEAK(gethostbyname2_async);
struct asr_query *
gethostbyaddr_async(const void *addr, socklen_t len, int af, void *asr)
@@ -120,6 +122,7 @@ gethostbyaddr_async(const void *addr, socklen_t len, int af, void *asr)
return (as);
}
+DEF_WEAK(gethostbyaddr_async);
struct asr_query *
_gethostbyaddr_async_ctx(const void *addr, socklen_t len, int af,
diff --git a/lib/libc/asr/getnameinfo_async.c b/lib/libc/asr/getnameinfo_async.c
index 1453fbd7ccf..f3a70502796 100644
--- a/lib/libc/asr/getnameinfo_async.c
+++ b/lib/libc/asr/getnameinfo_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnameinfo_async.c,v 1.10 2015/09/09 15:49:34 deraadt Exp $ */
+/* $OpenBSD: getnameinfo_async.c,v 1.11 2015/09/14 11:52:49 guenther Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -69,6 +69,7 @@ getnameinfo_async(const struct sockaddr *sa, socklen_t slen, char *host,
_asr_ctx_unref(ac);
return (NULL);
}
+DEF_WEAK(getnameinfo_async);
static int
getnameinfo_async_run(struct asr_query *as, struct asr_result *ar)
diff --git a/lib/libc/asr/getnetnamadr_async.c b/lib/libc/asr/getnetnamadr_async.c
index dcf290c4a16..5f623f3467a 100644
--- a/lib/libc/asr/getnetnamadr_async.c
+++ b/lib/libc/asr/getnetnamadr_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnetnamadr_async.c,v 1.21 2015/09/09 15:49:34 deraadt Exp $ */
+/* $OpenBSD: getnetnamadr_async.c,v 1.22 2015/09/14 11:52:49 guenther Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -79,6 +79,7 @@ getnetbyname_async(const char *name, void *asr)
_asr_ctx_unref(ac);
return (NULL);
}
+DEF_WEAK(getnetbyname_async);
struct asr_query *
getnetbyaddr_async(in_addr_t net, int family, void *asr)
@@ -103,6 +104,7 @@ getnetbyaddr_async(in_addr_t net, int family, void *asr)
_asr_ctx_unref(ac);
return (NULL);
}
+DEF_WEAK(getnetbyaddr_async);
static int
getnetnamadr_async_run(struct asr_query *as, struct asr_result *ar)
diff --git a/lib/libc/asr/getrrsetbyname_async.c b/lib/libc/asr/getrrsetbyname_async.c
index 7b885041e5c..5a80d2b64d2 100644
--- a/lib/libc/asr/getrrsetbyname_async.c
+++ b/lib/libc/asr/getrrsetbyname_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getrrsetbyname_async.c,v 1.8 2015/09/09 15:49:34 deraadt Exp $ */
+/* $OpenBSD: getrrsetbyname_async.c,v 1.9 2015/09/14 11:52:49 guenther Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -63,6 +63,7 @@ getrrsetbyname_async(const char *hostname, unsigned int rdclass,
_asr_ctx_unref(ac);
return (NULL);
}
+DEF_WEAK(getrrsetbyname_async);
static int
getrrsetbyname_async_run(struct asr_query *as, struct asr_result *ar)
@@ -170,7 +171,7 @@ getrrsetbyname_async_run(struct asr_query *as, struct asr_result *ar)
/* The rest of this file is taken from the orignal implementation. */
-/* $OpenBSD: getrrsetbyname_async.c,v 1.8 2015/09/09 15:49:34 deraadt Exp $ */
+/* $OpenBSD: getrrsetbyname_async.c,v 1.9 2015/09/14 11:52:49 guenther Exp $ */
/*
* Copyright (c) 2001 Jakob Schlyter. All rights reserved.
diff --git a/lib/libc/asr/res_search_async.c b/lib/libc/asr/res_search_async.c
index fd6669ca94f..b2fc44d29e7 100644
--- a/lib/libc/asr/res_search_async.c
+++ b/lib/libc/asr/res_search_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_search_async.c,v 1.16 2015/09/09 15:49:34 deraadt Exp $ */
+/* $OpenBSD: res_search_async.c,v 1.17 2015/09/14 11:52:49 guenther Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -52,6 +52,7 @@ res_search_async(const char *name, int class, int type, void *asr)
return (as);
}
+DEF_WEAK(res_search_async);
struct asr_query *
_res_search_async_ctx(const char *name, int class, int type, struct asr_ctx *ac)
diff --git a/lib/libc/asr/res_send_async.c b/lib/libc/asr/res_send_async.c
index b64c6350a6e..da90557e804 100644
--- a/lib/libc/asr/res_send_async.c
+++ b/lib/libc/asr/res_send_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_send_async.c,v 1.25 2015/09/09 15:49:34 deraadt Exp $ */
+/* $OpenBSD: res_send_async.c,v 1.26 2015/09/14 11:52:49 guenther Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -95,6 +95,7 @@ res_send_async(const unsigned char *buf, int buflen, void *asr)
_asr_ctx_unref(ac);
return (NULL);
}
+DEF_WEAK(res_send_async);
/*
* Unlike res_query(), this version will actually return the packet
@@ -115,6 +116,7 @@ res_query_async(const char *name, int class, int type, void *asr)
return (as);
}
+DEF_WEAK(res_query_async);
struct asr_query *
_res_query_async_ctx(const char *name, int class, int type, struct asr_ctx *a_ctx)