diff options
Diffstat (limited to 'libc/sysdeps/linux/common/pread_write.c')
-rw-r--r-- | libc/sysdeps/linux/common/pread_write.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c index 7183ac9a7..c622b22d2 100644 --- a/libc/sysdeps/linux/common/pread_write.c +++ b/libc/sysdeps/linux/common/pread_write.c @@ -40,6 +40,12 @@ #include <unistd.h> #include <stdint.h> +#ifdef __UCLIBC_HAS_LFS__ +libc_hidden_proto(lseek64) +#else +libc_hidden_proto(lseek) +#endif + #ifdef __NR_pread #define __NR___syscall_pread __NR_pread @@ -50,7 +56,7 @@ ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) { return(__syscall_pread(fd,buf,count,__LONG_LONG_PAIR (offset >> 31, offset))); } -weak_alias (__libc_pread, pread) +strong_alias(__libc_pread,pread) #if defined __UCLIBC_HAS_LFS__ ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset) @@ -59,7 +65,7 @@ ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset) uint32_t high = offset >> 32; return(__syscall_pread(fd, buf, count, __LONG_LONG_PAIR (high, low))); } -weak_alias (__libc_pread64, pread64) +strong_alias(__libc_pread64,pread64) #endif /* __UCLIBC_HAS_LFS__ */ #endif /* __NR_pread */ @@ -75,7 +81,7 @@ ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) { return(__syscall_pwrite(fd,buf,count,__LONG_LONG_PAIR (offset >> 31, offset))); } -weak_alias (__libc_pwrite, pwrite) +strong_alias(__libc_pwrite,pwrite) #if defined __UCLIBC_HAS_LFS__ ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset) @@ -84,7 +90,7 @@ ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset) uint32_t high = offset >> 32; return(__syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR (high, low))); } -weak_alias (__libc_pwrite64, pwrite64) +strong_alias(__libc_pwrite64,pwrite64) #endif /* __UCLIBC_HAS_LFS__ */ #endif /* __NR_pwrite */ @@ -100,11 +106,11 @@ static ssize_t __fake_pread_write(int fd, void *buf, /* Since we must not change the file pointer preserve the * value so that we can restore it later. */ - if ((old_offset=__lseek(fd, 0, SEEK_CUR)) == (off_t) -1) + if ((old_offset=lseek(fd, 0, SEEK_CUR)) == (off_t) -1) return -1; /* Set to wanted position. */ - if (__lseek (fd, offset, SEEK_SET) == (off_t) -1) + if (lseek (fd, offset, SEEK_SET) == (off_t) -1) return -1; if (do_pwrite==1) { @@ -118,7 +124,7 @@ static ssize_t __fake_pread_write(int fd, void *buf, /* Now we have to restore the position. If this fails we * have to return this as an error. */ save_errno = errno; - if (__lseek(fd, old_offset, SEEK_SET) == (off_t) -1) + if (lseek(fd, old_offset, SEEK_SET) == (off_t) -1) { if (result == -1) __set_errno(save_errno); @@ -138,11 +144,11 @@ static ssize_t __fake_pread_write64(int fd, void *buf, /* Since we must not change the file pointer preserve the * value so that we can restore it later. */ - if ((old_offset=__lseek64(fd, 0, SEEK_CUR)) == (off64_t) -1) + if ((old_offset=lseek64(fd, 0, SEEK_CUR)) == (off64_t) -1) return -1; /* Set to wanted position. */ - if (__lseek64(fd, offset, SEEK_SET) == (off64_t) -1) + if (lseek64(fd, offset, SEEK_SET) == (off64_t) -1) return -1; if (do_pwrite==1) { @@ -155,7 +161,7 @@ static ssize_t __fake_pread_write64(int fd, void *buf, /* Now we have to restore the position. */ save_errno = errno; - if (__lseek64 (fd, old_offset, SEEK_SET) == (off64_t) -1) { + if (lseek64 (fd, old_offset, SEEK_SET) == (off64_t) -1) { if (result == -1) __set_errno (save_errno); return -1; @@ -171,14 +177,14 @@ ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) { return(__fake_pread_write(fd, buf, count, offset, 0)); } -weak_alias (__libc_pread, pread) +strong_alias(__libc_pread,pread) #if defined __UCLIBC_HAS_LFS__ ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset) { return(__fake_pread_write64(fd, buf, count, offset, 0)); } -weak_alias (__libc_pread64, pread64) +strong_alias(__libc_pread64,pread64) #endif /* __UCLIBC_HAS_LFS__ */ #endif /* ! __NR_pread */ @@ -190,14 +196,13 @@ ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) *just cast it to get rid of warnings */ return(__fake_pread_write(fd, (void*)buf, count, offset, 1)); } -weak_alias (__libc_pwrite, pwrite) +strong_alias(__libc_pwrite,pwrite) #if defined __UCLIBC_HAS_LFS__ ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset) { return(__fake_pread_write64(fd, (void*)buf, count, offset, 1)); } -weak_alias (__libc_pwrite64, pwrite64) +strong_alias(__libc_pwrite64,pwrite64) #endif /* __UCLIBC_HAS_LFS__ */ #endif /* ! __NR_pwrite */ - |