mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] Fix dn_comp prototype and add stub
@ 2013-11-05  5:42 Michael Forney
  2013-11-05 14:26 ` Szabolcs Nagy
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Forney @ 2013-11-05  5:42 UTC (permalink / raw)
  To: musl

---
This function is used at least by ping6 from iputils, and if there is a header
declaration, there should at least be a stub.

 include/resolv.h      | 2 +-
 src/network/dn_comp.c | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100644 src/network/dn_comp.c

diff --git a/include/resolv.h b/include/resolv.h
index 259e4bc..cfa5d9d 100644
--- a/include/resolv.h
+++ b/include/resolv.h
@@ -133,7 +133,7 @@ int res_querydomain(const char *, const char *, int, int, unsigned char *, int);
 int res_search(const char *, int, int, unsigned char *, int);
 int res_mkquery(int, const char *, int, int, char *, int, struct rrec *, char *, int);
 int res_send(const char *, int, char *, int);
-int dn_comp(unsigned char *, unsigned char *, int, unsigned char **, unsigned char *, unsigned char **);
+int dn_comp(unsigned char *, unsigned char *, int, unsigned char **, unsigned char **);
 int dn_expand(const unsigned char *, const unsigned char *, const unsigned char *, char *, int);
 int dn_skipname(const unsigned char *, const unsigned char *);
 
diff --git a/src/network/dn_comp.c b/src/network/dn_comp.c
new file mode 100644
index 0000000..fe31cd7
--- /dev/null
+++ b/src/network/dn_comp.c
@@ -0,0 +1,9 @@
+#include <resolv.h>
+#include "libc.h"
+
+int __dn_comp(unsigned char *src, unsigned char *dst, int space, unsigned char **dnptrs, unsigned char **lastdnptr)
+{
+	return -1;
+}
+
+weak_alias(__dn_comp, dn_comp);
-- 
1.8.4.2



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix dn_comp prototype and add stub
  2013-11-05  5:42 [PATCH] Fix dn_comp prototype and add stub Michael Forney
@ 2013-11-05 14:26 ` Szabolcs Nagy
  2013-11-23 21:27   ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Szabolcs Nagy @ 2013-11-05 14:26 UTC (permalink / raw)
  To: musl

* Michael Forney <mforney@mforney.org> [2013-11-04 21:42:34 -0800]:
> -int dn_comp(unsigned char *, unsigned char *, int, unsigned char **, unsigned char *, unsigned char **);
> +int dn_comp(unsigned char *, unsigned char *, int, unsigned char **, unsigned char **);

bsd and glibc declaration is

int dn_comp(const char *, u_char *, int, u_char **, u_char **);

(the linux man is wrong about the first argument)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix dn_comp prototype and add stub
  2013-11-05 14:26 ` Szabolcs Nagy
@ 2013-11-23 21:27   ` Rich Felker
  2013-11-24  6:33     ` [PATCH v2] " Michael Forney
  0 siblings, 1 reply; 4+ messages in thread
From: Rich Felker @ 2013-11-23 21:27 UTC (permalink / raw)
  To: musl

On Tue, Nov 05, 2013 at 03:26:22PM +0100, Szabolcs Nagy wrote:
> * Michael Forney <mforney@mforney.org> [2013-11-04 21:42:34 -0800]:
> > -int dn_comp(unsigned char *, unsigned char *, int, unsigned char **, unsigned char *, unsigned char **);
> > +int dn_comp(unsigned char *, unsigned char *, int, unsigned char **, unsigned char **);
> 
> bsd and glibc declaration is
> 
> int dn_comp(const char *, u_char *, int, u_char **, u_char **);
> 
> (the linux man is wrong about the first argument)

Indeed. Michael, could you submit a revised version of this patch?

BTW, I think keeping the __-prefixed alias is okay and may actually be
useful for ABI-compat purposes; it looks like glibc's resolv.h exposes
the __-prefixed symbol names (via #define), so glibc-linked binaries
will be looking for the symbol with __.

Rich


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] Fix dn_comp prototype and add stub
  2013-11-23 21:27   ` Rich Felker
@ 2013-11-24  6:33     ` Michael Forney
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Forney @ 2013-11-24  6:33 UTC (permalink / raw)
  To: musl

This function is used by ping6 from iputils.
---
 include/resolv.h      | 2 +-
 src/network/dn_comp.c | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100644 src/network/dn_comp.c

diff --git a/include/resolv.h b/include/resolv.h
index 259e4bc..09fcfdf 100644
--- a/include/resolv.h
+++ b/include/resolv.h
@@ -133,7 +133,7 @@ int res_querydomain(const char *, const char *, int, int, unsigned char *, int);
 int res_search(const char *, int, int, unsigned char *, int);
 int res_mkquery(int, const char *, int, int, char *, int, struct rrec *, char *, int);
 int res_send(const char *, int, char *, int);
-int dn_comp(unsigned char *, unsigned char *, int, unsigned char **, unsigned char *, unsigned char **);
+int dn_comp(const char *, unsigned char *, int, unsigned char **, unsigned char **);
 int dn_expand(const unsigned char *, const unsigned char *, const unsigned char *, char *, int);
 int dn_skipname(const unsigned char *, const unsigned char *);
 
diff --git a/src/network/dn_comp.c b/src/network/dn_comp.c
new file mode 100644
index 0000000..4f4452a
--- /dev/null
+++ b/src/network/dn_comp.c
@@ -0,0 +1,9 @@
+#include <resolv.h>
+#include "libc.h"
+
+int __dn_comp(const char *src, unsigned char *dst, int space, unsigned char **dnptrs, unsigned char **lastdnptr)
+{
+	return -1;
+}
+
+weak_alias(__dn_comp, dn_comp);
-- 
1.8.4.2



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-24  6:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-05  5:42 [PATCH] Fix dn_comp prototype and add stub Michael Forney
2013-11-05 14:26 ` Szabolcs Nagy
2013-11-23 21:27   ` Rich Felker
2013-11-24  6:33     ` [PATCH v2] " Michael Forney

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).