From 63a4c9adf227a6f6a5f7f70f6dc3f8863f846927 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 12 Sep 2018 00:28:34 -0400 Subject: remove spurious inclusion of libc.h for LFS64 ABI aliases the LFS64 macro was not self-documenting and barely saved any characters. simply use weak_alias directly so that it's clear what's being done, and doesn't depend on a header to provide a strange macro. --- src/unistd/ftruncate.c | 3 +-- src/unistd/lseek.c | 3 +-- src/unistd/pread.c | 3 +-- src/unistd/preadv.c | 3 +-- src/unistd/pwrite.c | 3 +-- src/unistd/pwritev.c | 3 +-- src/unistd/truncate.c | 3 +-- 7 files changed, 7 insertions(+), 14 deletions(-) (limited to 'src/unistd') diff --git a/src/unistd/ftruncate.c b/src/unistd/ftruncate.c index 467135f0..b41be0fa 100644 --- a/src/unistd/ftruncate.c +++ b/src/unistd/ftruncate.c @@ -1,10 +1,9 @@ #include #include "syscall.h" -#include "libc.h" int ftruncate(int fd, off_t length) { return syscall(SYS_ftruncate, fd, __SYSCALL_LL_O(length)); } -LFS64(ftruncate); +weak_alias(ftruncate, ftruncate64); diff --git a/src/unistd/lseek.c b/src/unistd/lseek.c index 0a5ed392..bf8cd852 100644 --- a/src/unistd/lseek.c +++ b/src/unistd/lseek.c @@ -1,6 +1,5 @@ #include #include "syscall.h" -#include "libc.h" off_t lseek(int fd, off_t offset, int whence) { @@ -12,4 +11,4 @@ off_t lseek(int fd, off_t offset, int whence) #endif } -LFS64(lseek); +weak_alias(lseek, lseek64); diff --git a/src/unistd/pread.c b/src/unistd/pread.c index 5483eb9d..5681b045 100644 --- a/src/unistd/pread.c +++ b/src/unistd/pread.c @@ -1,10 +1,9 @@ #include #include "syscall.h" -#include "libc.h" ssize_t pread(int fd, void *buf, size_t size, off_t ofs) { return syscall_cp(SYS_pread, fd, buf, size, __SYSCALL_LL_PRW(ofs)); } -LFS64(pread); +weak_alias(pread, pread64); diff --git a/src/unistd/preadv.c b/src/unistd/preadv.c index 46d9ece7..8376d60f 100644 --- a/src/unistd/preadv.c +++ b/src/unistd/preadv.c @@ -2,7 +2,6 @@ #include #include #include "syscall.h" -#include "libc.h" ssize_t preadv(int fd, const struct iovec *iov, int count, off_t ofs) { @@ -10,4 +9,4 @@ ssize_t preadv(int fd, const struct iovec *iov, int count, off_t ofs) (long)(ofs), (long)(ofs>>32)); } -LFS64(preadv); +weak_alias(preadv, preadv64); diff --git a/src/unistd/pwrite.c b/src/unistd/pwrite.c index 4bf3d7df..ca376576 100644 --- a/src/unistd/pwrite.c +++ b/src/unistd/pwrite.c @@ -1,10 +1,9 @@ #include #include "syscall.h" -#include "libc.h" ssize_t pwrite(int fd, const void *buf, size_t size, off_t ofs) { return syscall_cp(SYS_pwrite, fd, buf, size, __SYSCALL_LL_PRW(ofs)); } -LFS64(pwrite); +weak_alias(pwrite, pwrite64); diff --git a/src/unistd/pwritev.c b/src/unistd/pwritev.c index aec5d323..f5a612c4 100644 --- a/src/unistd/pwritev.c +++ b/src/unistd/pwritev.c @@ -2,7 +2,6 @@ #include #include #include "syscall.h" -#include "libc.h" ssize_t pwritev(int fd, const struct iovec *iov, int count, off_t ofs) { @@ -10,4 +9,4 @@ ssize_t pwritev(int fd, const struct iovec *iov, int count, off_t ofs) (long)(ofs), (long)(ofs>>32)); } -LFS64(pwritev); +weak_alias(pwritev, pwritev64); diff --git a/src/unistd/truncate.c b/src/unistd/truncate.c index 8e65655c..97296800 100644 --- a/src/unistd/truncate.c +++ b/src/unistd/truncate.c @@ -1,10 +1,9 @@ #include #include "syscall.h" -#include "libc.h" int truncate(const char *path, off_t length) { return syscall(SYS_truncate, path, __SYSCALL_LL_O(length)); } -LFS64(truncate); +weak_alias(truncate, truncate64); -- cgit v1.2.1