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]

Fix aio_* pread namespace (bug 18519)


aio_* bring in references to pread, which isn't in all the standards
containing aio_* (as a reference from one library to another, this is
a bug for dynamic as well as static linking).  This patch fixes this
by using __libc_pread instead, exporting that function from libc at
symbol version GLIBC_PRIVATE; the code, with conditionals that may
call either __pread64 or __libc_pread, becomes exactly analogous to
that elsewhere in the same file that may call either __pwrite64 or
__libc_pwrite.

Tested for x86_64 and x86 (testsuite, and comparison of disassembly of
installed shared libraries).  libc changes because of the PLT entry
for the newly exported __libc_pread; librt changes because of
assertion line numbers and PLT rearrangement; other stripped installed
shared libraries do not change.

2015-06-11  Joseph Myers  <joseph@codesourcery.com>

	[BZ #18519]
	* posix/Versions (libc): Export __libc_pread at version
	GLIBC_PRIVATE.
	* sysdeps/pthread/aio_misc.c (handle_fildes_io): Call __libc_pread
	instead of pread.
	* conform/Makefile (test-xfail-POSIX/aio.h/linknamespace): Remove
	variable.

diff --git a/conform/Makefile b/conform/Makefile
index 8e76bcb..0c8da4c 100644
--- a/conform/Makefile
+++ b/conform/Makefile
@@ -355,7 +355,6 @@ test-xfail-XPG4/stdlib.h/linknamespace = yes
 test-xfail-XPG4/syslog.h/linknamespace = yes
 test-xfail-XPG4/unistd.h/linknamespace = yes
 test-xfail-XPG4/wordexp.h/linknamespace = yes
-test-xfail-POSIX/aio.h/linknamespace = yes
 test-xfail-POSIX/mqueue.h/linknamespace = yes
 test-xfail-POSIX/semaphore.h/linknamespace = yes
 test-xfail-UNIX98/fmtmsg.h/linknamespace = yes
diff --git a/posix/Versions b/posix/Versions
index 68df3a9..bb481a5 100644
--- a/posix/Versions
+++ b/posix/Versions
@@ -135,6 +135,6 @@ libc {
     execvpe;
   }
   GLIBC_PRIVATE {
-    __libc_fork; __libc_pwrite;
+    __libc_fork; __libc_pread; __libc_pwrite;
   }
 }
diff --git a/sysdeps/pthread/aio_misc.c b/sysdeps/pthread/aio_misc.c
index 83a6cb9..d9740d7 100644
--- a/sysdeps/pthread/aio_misc.c
+++ b/sysdeps/pthread/aio_misc.c
@@ -536,10 +536,11 @@ handle_fildes_io (void *arg)
 						 aiocbp->aiocb64.aio_offset));
 	      else
 		aiocbp->aiocb.__return_value =
-		  TEMP_FAILURE_RETRY (pread (fildes,
-					     (void *) aiocbp->aiocb.aio_buf,
-					     aiocbp->aiocb.aio_nbytes,
-					     aiocbp->aiocb.aio_offset));
+		  TEMP_FAILURE_RETRY (__libc_pread (fildes,
+						    (void *)
+						    aiocbp->aiocb.aio_buf,
+						    aiocbp->aiocb.aio_nbytes,
+						    aiocbp->aiocb.aio_offset));
 
 	      if (aiocbp->aiocb.__return_value == -1 && errno == ESPIPE)
 		/* The Linux kernel is different from others.  It returns

-- 
Joseph S. Myers
joseph@codesourcery.com


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