From: Julian Seward Date: Sat, 18 May 2002 10:56:27 +0000 (+0000) Subject: Cancellation wrappers for pread/pwrite (Philip Martin). X-Git-Tag: svn/VALGRIND_1_0_3~179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2560fc9e471c9495a317156952f52e7949b310a6;p=thirdparty%2Fvalgrind.git Cancellation wrappers for pread/pwrite (Philip Martin). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@287 --- diff --git a/coregrind/arch/x86-linux/vg_libpthread.c b/coregrind/arch/x86-linux/vg_libpthread.c index 93cb7373dd..c9956ccb74 100644 --- a/coregrind/arch/x86-linux/vg_libpthread.c +++ b/coregrind/arch/x86-linux/vg_libpthread.c @@ -1138,6 +1138,24 @@ ssize_t __pwrite64 (int __fd, const void *__buf, size_t __nbytes, } +extern +ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset); +__attribute__((weak)) +ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset) +{ + return __libc_pwrite(fd, buf, count, offset); +} + + +extern +ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset); +__attribute__((weak)) +ssize_t pread(int fd, void *buf, size_t count, off_t offset) +{ + return __libc_pread(fd, buf, count, offset); +} + + extern void __libc_longjmp(jmp_buf env, int val) __attribute((noreturn)); /* not weak: __attribute__((weak)) */ @@ -1556,8 +1574,6 @@ strong_alias(fcntl, __fcntl) strong_alias(lseek, __lseek) strong_alias(open, __open) strong_alias(open64, __open64) -//strong_alias(pread64, __pread64) -//strong_alias(pwrite64, __pwrite64) strong_alias(read, __read) strong_alias(wait, __wait) strong_alias(write, __write) diff --git a/coregrind/arch/x86-linux/vg_libpthread_unimp.c b/coregrind/arch/x86-linux/vg_libpthread_unimp.c index 93a1246945..66c586e7db 100644 --- a/coregrind/arch/x86-linux/vg_libpthread_unimp.c +++ b/coregrind/arch/x86-linux/vg_libpthread_unimp.c @@ -200,8 +200,8 @@ weak_alias(pthread_rwlock_trywrlock, __pthread_rwlock_trywrlock) //weak_alias(pthread_rwlock_wrlock, __pthread_rwlock_wrlock) weak_alias(_IO_ftrylockfile, ftrylockfile) -__attribute__((weak)) void pread ( void ) { vgPlain_unimp("pread"); } -__attribute__((weak)) void pwrite ( void ) { vgPlain_unimp("pwrite"); } +//__attribute__((weak)) void pread ( void ) { vgPlain_unimp("pread"); } +//__attribute__((weak)) void pwrite ( void ) { vgPlain_unimp("pwrite"); } __attribute__((weak)) void msync ( void ) { vgPlain_unimp("msync"); } __attribute__((weak)) void pause ( void ) { vgPlain_unimp("pause"); } __attribute__((weak)) void recvfrom ( void ) { vgPlain_unimp("recvfrom"); } diff --git a/coregrind/vg_libpthread.c b/coregrind/vg_libpthread.c index 93cb7373dd..c9956ccb74 100644 --- a/coregrind/vg_libpthread.c +++ b/coregrind/vg_libpthread.c @@ -1138,6 +1138,24 @@ ssize_t __pwrite64 (int __fd, const void *__buf, size_t __nbytes, } +extern +ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset); +__attribute__((weak)) +ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset) +{ + return __libc_pwrite(fd, buf, count, offset); +} + + +extern +ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset); +__attribute__((weak)) +ssize_t pread(int fd, void *buf, size_t count, off_t offset) +{ + return __libc_pread(fd, buf, count, offset); +} + + extern void __libc_longjmp(jmp_buf env, int val) __attribute((noreturn)); /* not weak: __attribute__((weak)) */ @@ -1556,8 +1574,6 @@ strong_alias(fcntl, __fcntl) strong_alias(lseek, __lseek) strong_alias(open, __open) strong_alias(open64, __open64) -//strong_alias(pread64, __pread64) -//strong_alias(pwrite64, __pwrite64) strong_alias(read, __read) strong_alias(wait, __wait) strong_alias(write, __write) diff --git a/coregrind/vg_libpthread_unimp.c b/coregrind/vg_libpthread_unimp.c index 93a1246945..66c586e7db 100644 --- a/coregrind/vg_libpthread_unimp.c +++ b/coregrind/vg_libpthread_unimp.c @@ -200,8 +200,8 @@ weak_alias(pthread_rwlock_trywrlock, __pthread_rwlock_trywrlock) //weak_alias(pthread_rwlock_wrlock, __pthread_rwlock_wrlock) weak_alias(_IO_ftrylockfile, ftrylockfile) -__attribute__((weak)) void pread ( void ) { vgPlain_unimp("pread"); } -__attribute__((weak)) void pwrite ( void ) { vgPlain_unimp("pwrite"); } +//__attribute__((weak)) void pread ( void ) { vgPlain_unimp("pread"); } +//__attribute__((weak)) void pwrite ( void ) { vgPlain_unimp("pwrite"); } __attribute__((weak)) void msync ( void ) { vgPlain_unimp("msync"); } __attribute__((weak)) void pause ( void ) { vgPlain_unimp("pause"); } __attribute__((weak)) void recvfrom ( void ) { vgPlain_unimp("recvfrom"); } diff --git a/vg_libpthread.c b/vg_libpthread.c index 93cb7373dd..c9956ccb74 100644 --- a/vg_libpthread.c +++ b/vg_libpthread.c @@ -1138,6 +1138,24 @@ ssize_t __pwrite64 (int __fd, const void *__buf, size_t __nbytes, } +extern +ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset); +__attribute__((weak)) +ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset) +{ + return __libc_pwrite(fd, buf, count, offset); +} + + +extern +ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset); +__attribute__((weak)) +ssize_t pread(int fd, void *buf, size_t count, off_t offset) +{ + return __libc_pread(fd, buf, count, offset); +} + + extern void __libc_longjmp(jmp_buf env, int val) __attribute((noreturn)); /* not weak: __attribute__((weak)) */ @@ -1556,8 +1574,6 @@ strong_alias(fcntl, __fcntl) strong_alias(lseek, __lseek) strong_alias(open, __open) strong_alias(open64, __open64) -//strong_alias(pread64, __pread64) -//strong_alias(pwrite64, __pwrite64) strong_alias(read, __read) strong_alias(wait, __wait) strong_alias(write, __write) diff --git a/vg_libpthread_unimp.c b/vg_libpthread_unimp.c index 93a1246945..66c586e7db 100644 --- a/vg_libpthread_unimp.c +++ b/vg_libpthread_unimp.c @@ -200,8 +200,8 @@ weak_alias(pthread_rwlock_trywrlock, __pthread_rwlock_trywrlock) //weak_alias(pthread_rwlock_wrlock, __pthread_rwlock_wrlock) weak_alias(_IO_ftrylockfile, ftrylockfile) -__attribute__((weak)) void pread ( void ) { vgPlain_unimp("pread"); } -__attribute__((weak)) void pwrite ( void ) { vgPlain_unimp("pwrite"); } +//__attribute__((weak)) void pread ( void ) { vgPlain_unimp("pread"); } +//__attribute__((weak)) void pwrite ( void ) { vgPlain_unimp("pwrite"); } __attribute__((weak)) void msync ( void ) { vgPlain_unimp("msync"); } __attribute__((weak)) void pause ( void ) { vgPlain_unimp("pause"); } __attribute__((weak)) void recvfrom ( void ) { vgPlain_unimp("recvfrom"); }