From: hjl@varesearch.com (H.J. Lu)
To: geoffk@ozemail.com.au (Geoff Keating)
Cc: libc-hacker@sourceware.cygnus.com (GNU C Library),
drepper@cygnus.com (Ulrich Drepper)
Subject: Re: A patch for nscd
Date: Mon, 12 Jul 1999 09:19:00 -0000 [thread overview]
Message-ID: <19990712161927.63B1D3FC1@varesearch.com> (raw)
In-Reply-To: <199907120103.LAA00548@geoffk.wattle.id.au>
>
> > nscd has its own get[a-z]*_r functions. But nscd uses the weak names
> > to call those functions. As the result of my get[a-z]*_r version
> > change, which makes get[a-z]*_r strong instead of weak, and a linker
> > bug fix, the strong versions of get[a-z]*_r in libc.so are used. Here
> > is a patch to use nscd's own get[a-z]*_r functions.
>
> Why is 'get[a-z]*_r' strong? Won't this affect static ISO C programs
> that define their own?
get.*_r is a weak aliase of __get[a-z]*_r. However, get.*_r is strong
in libc.so with my get.*_r version patch. The latest linker will pick
the strong version over the weak one even if the strong one is in
shared library and the weak one is in .o file.
Here is the updated patch. It seems to work for me now.
--
H.J. Lu (hjl@gnu.org)
---
Sun Jul 11 17:36:43 1999 H.J. Lu <hjl@gnu.org>
* nscd/grpcache.c: Add prefix "__" to get[a-z]*_r () to get
nscd's own strong version of the get[a-z]*_r function.
* nscd/hstcache.c: Likwise.
* nscd/pwdcache.c: Likwise.
Index: nscd/grpcache.c
===================================================================
RCS file: /work/cvs/gnu/glibc-2.1/nscd/grpcache.c,v
retrieving revision 1.1.1.9
diff -u -p -r1.1.1.9 grpcache.c
--- nscd/grpcache.c 1999/06/27 01:14:33 1.1.1.9
+++ nscd/grpcache.c 1999/07/12 00:29:58
@@ -208,7 +208,7 @@ addgrbyname (struct database *db, int fd
if (debug_level > 0)
dbg_log (_("Haven't found \"%s\" in group cache!"), key);
- while (getgrnam_r (key, &resultbuf, buffer, buflen, &grp) != 0
+ while (__getgrnam_r (key, &resultbuf, buffer, buflen, &grp) != 0
&& errno == ERANGE)
{
errno = 0;
@@ -236,7 +236,7 @@ addgrbygid (struct database *db, int fd,
if (debug_level > 0)
dbg_log (_("Haven't found \"%d\" in group cache!"), gid);
- while (getgrgid_r (gid, &resultbuf, buffer, buflen, &grp) != 0
+ while (__getgrgid_r (gid, &resultbuf, buffer, buflen, &grp) != 0
&& errno == ERANGE)
{
errno = 0;
Index: nscd/hstcache.c
===================================================================
RCS file: /work/cvs/gnu/glibc-2.1/nscd/hstcache.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 hstcache.c
--- nscd/hstcache.c 1999/06/27 01:14:33 1.1.1.3
+++ nscd/hstcache.c 1999/07/12 16:11:27
@@ -296,8 +296,8 @@ addhstbyname (struct database *db, int f
if (debug_level > 0)
dbg_log (_("Haven't found \"%s\" in hosts cache!"), key);
- while (gethostbyname2_r (key, AF_INET, &resultbuf, buffer, buflen, &hst,
- &h_errno) != 0
+ while (__gethostbyname2_r (key, AF_INET, &resultbuf, buffer, buflen,
+ &hst, &h_errno) != 0
&& h_errno == NETDB_INTERNAL
&& errno == ERANGE)
{
@@ -329,8 +329,8 @@ addhstbyaddr (struct database *db, int f
inet_ntop (AF_INET, key, buf, sizeof (buf)));
}
- while (gethostbyaddr_r (key, INADDRSZ, AF_INET, &resultbuf, buffer, buflen,
- &hst, &h_errno) != 0
+ while (__gethostbyaddr_r (key, INADDRSZ, AF_INET, &resultbuf, buffer,
+ buflen, &hst, &h_errno) != 0
&& h_errno == NETDB_INTERNAL
&& errno == ERANGE)
{
@@ -363,8 +363,8 @@ addhstbynamev6 (struct database *db, int
inet_ntop (AF_INET6, key, buf, sizeof (buf)));
}
- while (gethostbyname2_r (key, AF_INET6, &resultbuf, buffer, buflen, &hst,
- &h_errno) != 0
+ while (__gethostbyname2_r (key, AF_INET6, &resultbuf, buffer, buflen,
+ &hst, &h_errno) != 0
&& h_errno == NETDB_INTERNAL
&& errno == ERANGE)
{
@@ -396,8 +396,8 @@ addhstbyaddrv6 (struct database *db, int
inet_ntop (AF_INET6, key, buf, sizeof (buf)));
}
- while (gethostbyaddr_r (key, IN6ADDRSZ, AF_INET6, &resultbuf, buffer, buflen,
- &hst, &h_errno) != 0
+ while (__gethostbyaddr_r (key, IN6ADDRSZ, AF_INET6, &resultbuf,
+ buffer, buflen, &hst, &h_errno) != 0
&& h_errno == NETDB_INTERNAL
&& errno == ERANGE)
{
Index: nscd/pwdcache.c
===================================================================
RCS file: /work/cvs/gnu/glibc-2.1/nscd/pwdcache.c,v
retrieving revision 1.1.1.6
diff -u -p -r1.1.1.6 pwdcache.c
--- nscd/pwdcache.c 1999/06/27 01:14:33 1.1.1.6
+++ nscd/pwdcache.c 1999/07/12 00:31:29
@@ -206,7 +206,7 @@ addpwbyname (struct database *db, int fd
if (debug_level > 0)
dbg_log (_("Haven't found \"%s\" in password cache!"), key);
- while (getpwnam_r (key, &resultbuf, buffer, buflen, &pwd) != 0
+ while (__getpwnam_r (key, &resultbuf, buffer, buflen, &pwd) != 0
&& errno == ERANGE)
{
errno = 0;
@@ -234,7 +234,7 @@ addpwbyuid (struct database *db, int fd,
if (debug_level > 0)
dbg_log (_("Haven't found \"%d\" in password cache!"), uid);
- while (getpwuid_r (uid, &resultbuf, buffer, buflen, &pwd) != 0
+ while (__getpwuid_r (uid, &resultbuf, buffer, buflen, &pwd) != 0
&& errno == ERANGE)
{
errno = 0;
next parent reply other threads:[~1999-07-12 9:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <199907120103.LAA00548@geoffk.wattle.id.au>
1999-07-12 9:19 ` H.J. Lu [this message]
1999-07-12 18:16 ` Ulrich Drepper
1999-07-11 17:44 H.J. Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19990712161927.63B1D3FC1@varesearch.com \
--to=hjl@varesearch.com \
--cc=drepper@cygnus.com \
--cc=geoffk@ozemail.com.au \
--cc=libc-hacker@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).