authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-05-17 10:42:32-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-05-17 10:42:32-07:00
logad20236e977cf6e55f2da1340952e521e2507786
treecaee1674b077f20374fe1f5a6382f39826451bc3
parentc1add1e19ea35b4d96fbab317410276f757510ef
parent892d4e13027b4469f89f9b0d75991639a87cd03f
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #15573 from motiejus/resolv_dn

glibc hacks: also add a few dn_* functions

3 files changed, 20 insertions(+), 9 deletions(-)

lib/libc/glibc/README.md+1
...@@ -6,3 +6,4 @@ need to be cherry-picked in the future glibc header upgrades:...@@ -6,3 +6,4 @@ need to be cherry-picked in the future glibc header upgrades:
66
7- 39083c31a550ed80f369f60d35791e98904b80967- 39083c31a550ed80f369f60d35791e98904b8096
8- a89813ef282c092a9caf699731c7faaf485acabe8- a89813ef282c092a9caf699731c7faaf485acabe
9- 3eaca9bbc6fee4b6be0f22b844f7d3214222f434
lib/libc/include/generic-glibc/resolv.h+16-9
...@@ -170,16 +170,20 @@ __END_DECLS...@@ -170,16 +170,20 @@ __END_DECLS
170#define res_isourserver __res_isourserver170#define res_isourserver __res_isourserver
171171
172/* In glibc 2.33 and earlier res_search, res_nsearch, res_query, res_nquery,172/* In glibc 2.33 and earlier res_search, res_nsearch, res_query, res_nquery,
173 * res_querydomain, res_nquerydomain were #define'd to __res_search,173 * res_querydomain, res_nquerydomain, dn_skipname, dn_comp, dn_expand were
174 * __res_nsearch, etc. glibc 2.34 onwards removes the macros and exposes the174 * #define'd to __res_search, __res_nsearch, etc. glibc 2.34 onwards removes
175 * symbols directly. New glibc exposes compat symbols with underscores for175 * the macros and exposes the symbols directly. New glibc exposes compat
176 * backwards compatibility. Applications linked to glibc 2.34+ are expected176 * symbols with underscores for backwards compatibility. Applications linked to
177 * to use the non-underscored symbols.177 * glibc 2.34+ are expected to use the non-underscored symbols.
178 *178 *
179 * It will be enough to bring the macros back when compiling against the older179 * It is enough to bring the macros back when compiling against the older glibc
180 * glibc versions.180 * versions.
181 *181 *
182 * See glibc commit ea9878ec271c791880fcbbe519d70c42f8113750.182 * See glibc commits:
183 * - ea9878ec271c791880fcbbe519d70c42f8113750 res_*
184 * - 391e02236b931132c0e8b5ba4c3b087c2aaa1044 dn_skipname
185 * - fd8a87c0c1932de591e7ad108ff6288a4b6b18c9 dn_comp
186 * - 640bbdf71c6f10ac26252ac67a22902e26657bd8 dn_expand
183 */187 */
184#if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 34)188#if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 34)
185#define res_search __res_search189#define res_search __res_search
...@@ -188,6 +192,9 @@ __END_DECLS...@@ -188,6 +192,9 @@ __END_DECLS
188#define res_nquery __res_nquery192#define res_nquery __res_nquery
189#define res_querydomain __res_querydomain193#define res_querydomain __res_querydomain
190#define res_nquerydomain __res_nquerydomain194#define res_nquerydomain __res_nquerydomain
195#define dn_skipname __dn_skipname
196#define dn_comp __dn_comp
197#define dn_expand __dn_expand
191#endif198#endif
192/* end glibc compat hacks */199/* end glibc compat hacks */
193200
...@@ -327,4 +334,4 @@ void res_nclose (res_state) __THROW;...@@ -327,4 +334,4 @@ void res_nclose (res_state) __THROW;
327334
328__END_DECLS335__END_DECLS
329336
330#endif /* !_RESOLV_H_ */
\ No newline at end of file
337#endif /* !_RESOLV_H_ */
test/link/glibc_compat/main.c+3
...@@ -34,4 +34,7 @@ int main() {...@@ -34,4 +34,7 @@ int main() {
34 printf("address to res_nquery: %p\n", res_nquery);34 printf("address to res_nquery: %p\n", res_nquery);
35 printf("address to res_querydomain: %p\n", res_querydomain);35 printf("address to res_querydomain: %p\n", res_querydomain);
36 printf("address to res_nquerydomain: %p\n", res_nquerydomain);36 printf("address to res_nquerydomain: %p\n", res_nquerydomain);
37 printf("address to dn_skipname: %p\n", dn_skipname);
38 printf("address to dn_comp: %p\n", dn_comp);
39 printf("address to dn_expand: %p\n", dn_expand);
37}40}