summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
-rw-r--r--lib/libc/hidden/asr.h38
9 files changed, 60 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)
diff --git a/lib/libc/hidden/asr.h b/lib/libc/hidden/asr.h
new file mode 100644
index 00000000000..94fa18ccf5f
--- /dev/null
+++ b/lib/libc/hidden/asr.h
@@ -0,0 +1,38 @@
+/* $OpenBSD: asr.h,v 1.1 2015/09/14 11:52:49 guenther Exp $ */
+/*
+ * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _LIBC_ASR_H_
+#define _LIBC_ASR_H_
+
+#include_next <asr.h>
+
+PROTO_DEPRECATED(asr_abort);
+PROTO_NORMAL(asr_run);
+PROTO_NORMAL(asr_run_sync);
+PROTO_NORMAL(getaddrinfo_async);
+PROTO_NORMAL(gethostbyaddr_async);
+PROTO_NORMAL(gethostbyname2_async);
+PROTO_NORMAL(gethostbyname_async);
+PROTO_NORMAL(getnameinfo_async);
+PROTO_NORMAL(getnetbyaddr_async);
+PROTO_NORMAL(getnetbyname_async);
+PROTO_NORMAL(getrrsetbyname_async);
+PROTO_NORMAL(res_query_async);
+PROTO_NORMAL(res_search_async);
+PROTO_NORMAL(res_send_async);
+
+#endif /* _LIBC_ASR_H_ */