This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Make getsockopt() a weak symbol


Hi,

I guess getsockopt wasn't a weak alias because the boilerplate was
initially copied fro socket/getsockopt.c, which doesn't have it. This
makes it a weak alias as for setsockopt.

I've made a quick test and it seems alright.

Please let me know if I'm missing something.

Regards,
Emilio

---
 sysdeps/mach/hurd/getsockopt.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

2010-06-02  Emilio Pozuelo Monfort  <pochu27@gmail.com>

	* sysdeps/mach/hurd/getsockopt.c (getsockopt): Rename to ...
	(__getsockopt): ...this.
	(getsockopt): Make getsockopt a weak alias to __getsockopt.

diff --git a/sysdeps/mach/hurd/getsockopt.c b/sysdeps/mach/hurd/getsockopt.c
index 7e35fa5..ba667fa 100644
--- a/sysdeps/mach/hurd/getsockopt.c
+++ b/sysdeps/mach/hurd/getsockopt.c
@@ -27,13 +27,12 @@
    into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's
    actual length.  Returns 0 on success, -1 for errors.  */
 
-/* XXX should be __getsockopt ? */
 int
-getsockopt (int fd,
-	    int level,
-	    int optname,
-	    void *optval,
-	    socklen_t *optlen)
+__getsockopt (int fd,
+	      int level,
+	      int optname,
+	      void *optval,
+	      socklen_t *optlen)
 {
   error_t err;
   char *buf = optval;
@@ -54,3 +53,5 @@ getsockopt (int fd,
 
   return 0;
 }
+
+weak_alias (__getsockopt, getsockopt)
-- 
1.7.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]