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/aio/aio.c | 12 ++++++------ src/aio/aio_suspend.c | 2 +- src/aio/lio_listio.c | 2 +- src/dirent/alphasort.c | 3 +-- src/dirent/readdir.c | 3 +-- src/dirent/readdir_r.c | 2 +- src/dirent/scandir.c | 3 +-- src/dirent/versionsort.c | 3 +-- src/fcntl/creat.c | 3 +-- src/fcntl/open.c | 3 +-- src/fcntl/openat.c | 3 +-- src/fcntl/posix_fadvise.c | 3 +-- src/fcntl/posix_fallocate.c | 3 +-- src/internal/libc.h | 6 ------ src/legacy/ftw.c | 3 +-- src/linux/fallocate.c | 3 +-- src/linux/getdents.c | 3 +-- src/linux/prlimit.c | 3 +-- src/linux/sendfile.c | 3 +-- src/misc/getrlimit.c | 3 +-- src/misc/lockf.c | 3 +-- src/misc/nftw.c | 3 +-- src/misc/setrlimit.c | 2 +- src/mman/mmap.c | 3 +-- src/regex/glob.c | 5 ++--- src/stat/__xstat.c | 9 ++++----- src/stat/fstat.c | 3 +-- src/stat/fstatat.c | 3 +-- src/stat/lstat.c | 3 +-- src/stat/stat.c | 3 +-- src/stat/statvfs.c | 9 ++++----- src/stdio/fgetpos.c | 3 +-- src/stdio/fopen.c | 3 +-- src/stdio/freopen.c | 3 +-- src/stdio/fseek.c | 3 +-- src/stdio/fsetpos.c | 3 +-- src/stdio/ftell.c | 3 +-- src/stdio/tmpfile.c | 3 +-- src/temp/mkostemp.c | 3 +-- src/temp/mkstemp.c | 3 +-- src/temp/mkstemps.c | 3 +-- 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 +-- 48 files changed, 59 insertions(+), 107 deletions(-) (limited to 'src') diff --git a/src/aio/aio.c b/src/aio/aio.c index a5f6443..628e842 100644 --- a/src/aio/aio.c +++ b/src/aio/aio.c @@ -370,9 +370,9 @@ int __aio_close(int fd) return fd; } -LFS64(aio_cancel); -LFS64(aio_error); -LFS64(aio_fsync); -LFS64(aio_read); -LFS64(aio_write); -LFS64(aio_return); +weak_alias(aio_cancel, aio_cancel64); +weak_alias(aio_error, aio_error64); +weak_alias(aio_fsync, aio_fsync64); +weak_alias(aio_read, aio_read64); +weak_alias(aio_write, aio_write64); +weak_alias(aio_return, aio_return64); diff --git a/src/aio/aio_suspend.c b/src/aio/aio_suspend.c index 0b3abe5..9b24b6a 100644 --- a/src/aio/aio_suspend.c +++ b/src/aio/aio_suspend.c @@ -73,4 +73,4 @@ int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec } } -LFS64(aio_suspend); +weak_alias(aio_suspend, aio_suspend64); diff --git a/src/aio/lio_listio.c b/src/aio/lio_listio.c index bd64546..7b6a03d 100644 --- a/src/aio/lio_listio.c +++ b/src/aio/lio_listio.c @@ -140,4 +140,4 @@ int lio_listio(int mode, struct aiocb *restrict const *restrict cbs, int cnt, st return 0; } -LFS64(lio_listio); +weak_alias(lio_listio, lio_listio64); diff --git a/src/dirent/alphasort.c b/src/dirent/alphasort.c index 42050fb..bee672e 100644 --- a/src/dirent/alphasort.c +++ b/src/dirent/alphasort.c @@ -1,10 +1,9 @@ #include #include -#include "libc.h" int alphasort(const struct dirent **a, const struct dirent **b) { return strcoll((*a)->d_name, (*b)->d_name); } -LFS64(alphasort); +weak_alias(alphasort, alphasort64); diff --git a/src/dirent/readdir.c b/src/dirent/readdir.c index eef92f7..569fc70 100644 --- a/src/dirent/readdir.c +++ b/src/dirent/readdir.c @@ -3,7 +3,6 @@ #include #include "__dirent.h" #include "syscall.h" -#include "libc.h" typedef char dirstream_buf_alignment_check[1-2*(int)( offsetof(struct __dirstream, buf) % sizeof(off_t))]; @@ -27,4 +26,4 @@ struct dirent *readdir(DIR *dir) return de; } -LFS64(readdir); +weak_alias(readdir, readdir64); diff --git a/src/dirent/readdir_r.c b/src/dirent/readdir_r.c index daa6c6e..6293a51 100644 --- a/src/dirent/readdir_r.c +++ b/src/dirent/readdir_r.c @@ -26,4 +26,4 @@ int readdir_r(DIR *restrict dir, struct dirent *restrict buf, struct dirent **re return 0; } -LFS64_2(readdir_r, readdir64_r); +weak_alias(readdir_r, readdir64_r); diff --git a/src/dirent/scandir.c b/src/dirent/scandir.c index 3af2b50..7ee195d 100644 --- a/src/dirent/scandir.c +++ b/src/dirent/scandir.c @@ -4,7 +4,6 @@ #include #include #include -#include "libc.h" int scandir(const char *path, struct dirent ***res, int (*sel)(const struct dirent *), @@ -45,4 +44,4 @@ int scandir(const char *path, struct dirent ***res, return cnt; } -LFS64(scandir); +weak_alias(scandir, scandir64); diff --git a/src/dirent/versionsort.c b/src/dirent/versionsort.c index 410cb70..d4c4892 100644 --- a/src/dirent/versionsort.c +++ b/src/dirent/versionsort.c @@ -1,7 +1,6 @@ #define _GNU_SOURCE #include #include -#include "libc.h" int versionsort(const struct dirent **a, const struct dirent **b) { @@ -9,4 +8,4 @@ int versionsort(const struct dirent **a, const struct dirent **b) } #undef versionsort64 -LFS64(versionsort); +weak_alias(versionsort, versionsort64); diff --git a/src/fcntl/creat.c b/src/fcntl/creat.c index be05faa..8f8aab6 100644 --- a/src/fcntl/creat.c +++ b/src/fcntl/creat.c @@ -1,9 +1,8 @@ #include -#include "libc.h" int creat(const char *filename, mode_t mode) { return open(filename, O_CREAT|O_WRONLY|O_TRUNC, mode); } -LFS64(creat); +weak_alias(creat, creat64); diff --git a/src/fcntl/open.c b/src/fcntl/open.c index 3928a6e..1d817a2 100644 --- a/src/fcntl/open.c +++ b/src/fcntl/open.c @@ -1,7 +1,6 @@ #include #include #include "syscall.h" -#include "libc.h" int open(const char *filename, int flags, ...) { @@ -21,4 +20,4 @@ int open(const char *filename, int flags, ...) return __syscall_ret(fd); } -LFS64(open); +weak_alias(open, open64); diff --git a/src/fcntl/openat.c b/src/fcntl/openat.c index e741336..ad165ec 100644 --- a/src/fcntl/openat.c +++ b/src/fcntl/openat.c @@ -1,7 +1,6 @@ #include #include #include "syscall.h" -#include "libc.h" int openat(int fd, const char *filename, int flags, ...) { @@ -17,4 +16,4 @@ int openat(int fd, const char *filename, int flags, ...) return syscall_cp(SYS_openat, fd, filename, flags|O_LARGEFILE, mode); } -LFS64(openat); +weak_alias(openat, openat64); diff --git a/src/fcntl/posix_fadvise.c b/src/fcntl/posix_fadvise.c index c1a0ef5..75b8e1a 100644 --- a/src/fcntl/posix_fadvise.c +++ b/src/fcntl/posix_fadvise.c @@ -1,6 +1,5 @@ #include #include "syscall.h" -#include "libc.h" int posix_fadvise(int fd, off_t base, off_t len, int advice) { @@ -16,4 +15,4 @@ int posix_fadvise(int fd, off_t base, off_t len, int advice) #endif } -LFS64(posix_fadvise); +weak_alias(posix_fadvise, posix_fadvise64); diff --git a/src/fcntl/posix_fallocate.c b/src/fcntl/posix_fallocate.c index 91d8063..c57a24a 100644 --- a/src/fcntl/posix_fallocate.c +++ b/src/fcntl/posix_fallocate.c @@ -1,6 +1,5 @@ #include #include "syscall.h" -#include "libc.h" int posix_fallocate(int fd, off_t base, off_t len) { @@ -8,4 +7,4 @@ int posix_fallocate(int fd, off_t base, off_t len) __SYSCALL_LL_E(len)); } -LFS64(posix_fallocate); +weak_alias(posix_fallocate, posix_fallocate64); diff --git a/src/internal/libc.h b/src/internal/libc.h index 83ad398..e4fe9e9 100644 --- a/src/internal/libc.h +++ b/src/internal/libc.h @@ -59,10 +59,4 @@ hidden void __unlock(volatile int *); hidden void __synccall(void (*)(void *), void *); hidden int __setxid(int, int, int, int); -#undef LFS64_2 -#define LFS64_2(x, y) weak_alias(x, y) - -#undef LFS64 -#define LFS64(x) LFS64_2(x, x##64) - #endif diff --git a/src/legacy/ftw.c b/src/legacy/ftw.c index 0429aba..506bd29 100644 --- a/src/legacy/ftw.c +++ b/src/legacy/ftw.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int ftw(const char *path, int (*fn)(const char *, const struct stat *, int), int fd_limit) { @@ -9,4 +8,4 @@ int ftw(const char *path, int (*fn)(const char *, const struct stat *, int), int return nftw(path, (int (*)())fn, fd_limit, FTW_PHYS); } -LFS64(ftw); +weak_alias(ftw, ftw64); diff --git a/src/linux/fallocate.c b/src/linux/fallocate.c index ae766d5..7d68bc8 100644 --- a/src/linux/fallocate.c +++ b/src/linux/fallocate.c @@ -1,7 +1,6 @@ #define _GNU_SOURCE #include #include "syscall.h" -#include "libc.h" int fallocate(int fd, int mode, off_t base, off_t len) { @@ -10,4 +9,4 @@ int fallocate(int fd, int mode, off_t base, off_t len) } #undef fallocate64 -LFS64(fallocate); +weak_alias(fallocate, fallocate64); diff --git a/src/linux/getdents.c b/src/linux/getdents.c index cab2995..de6de3b 100644 --- a/src/linux/getdents.c +++ b/src/linux/getdents.c @@ -1,11 +1,10 @@ #define _BSD_SOURCE #include #include "syscall.h" -#include "libc.h" int getdents(int fd, struct dirent *buf, size_t len) { return syscall(SYS_getdents, fd, buf, len); } -LFS64(getdents); +weak_alias(getdents, getdents64); diff --git a/src/linux/prlimit.c b/src/linux/prlimit.c index 0fe28e1..3df9ffb 100644 --- a/src/linux/prlimit.c +++ b/src/linux/prlimit.c @@ -1,7 +1,6 @@ #define _GNU_SOURCE #include #include "syscall.h" -#include "libc.h" #define FIX(x) do{ if ((x)>=SYSCALL_RLIM_INFINITY) (x)=RLIM_INFINITY; }while(0) @@ -24,4 +23,4 @@ int prlimit(pid_t pid, int resource, const struct rlimit *new_limit, struct rlim } #undef prlimit64 -LFS64(prlimit); +weak_alias(prlimit, prlimit64); diff --git a/src/linux/sendfile.c b/src/linux/sendfile.c index d63f419..9afe6dd 100644 --- a/src/linux/sendfile.c +++ b/src/linux/sendfile.c @@ -1,10 +1,9 @@ #include #include "syscall.h" -#include "libc.h" ssize_t sendfile(int out_fd, int in_fd, off_t *ofs, size_t count) { return syscall(SYS_sendfile, out_fd, in_fd, ofs, count); } -LFS64(sendfile); +weak_alias(sendfile, sendfile64); diff --git a/src/misc/getrlimit.c b/src/misc/getrlimit.c index b073677..2ab2f0f 100644 --- a/src/misc/getrlimit.c +++ b/src/misc/getrlimit.c @@ -1,7 +1,6 @@ #include #include #include "syscall.h" -#include "libc.h" #define FIX(x) do{ if ((x)>=SYSCALL_RLIM_INFINITY) (x)=RLIM_INFINITY; }while(0) @@ -24,4 +23,4 @@ int getrlimit(int resource, struct rlimit *rlim) return 0; } -LFS64(getrlimit); +weak_alias(getrlimit, getrlimit64); diff --git a/src/misc/lockf.c b/src/misc/lockf.c index d8f82ef..16a80be 100644 --- a/src/misc/lockf.c +++ b/src/misc/lockf.c @@ -1,7 +1,6 @@ #include #include #include -#include "libc.h" int lockf(int fd, int op, off_t size) { @@ -30,4 +29,4 @@ int lockf(int fd, int op, off_t size) return -1; } -LFS64(lockf); +weak_alias(lockf, lockf64); diff --git a/src/misc/nftw.c b/src/misc/nftw.c index eb9014b..0a46410 100644 --- a/src/misc/nftw.c +++ b/src/misc/nftw.c @@ -6,7 +6,6 @@ #include #include #include -#include "libc.h" struct history { @@ -126,4 +125,4 @@ int nftw(const char *path, int (*fn)(const char *, const struct stat *, int, str return r; } -LFS64(nftw); +weak_alias(nftw, nftw64); diff --git a/src/misc/setrlimit.c b/src/misc/setrlimit.c index 8a50f41..7a66ab2 100644 --- a/src/misc/setrlimit.c +++ b/src/misc/setrlimit.c @@ -47,4 +47,4 @@ int setrlimit(int resource, const struct rlimit *rlim) return 0; } -LFS64(setrlimit); +weak_alias(setrlimit, setrlimit64); diff --git a/src/mman/mmap.c b/src/mman/mmap.c index 1592403..eff88d8 100644 --- a/src/mman/mmap.c +++ b/src/mman/mmap.c @@ -4,7 +4,6 @@ #include #include #include "syscall.h" -#include "libc.h" static void dummy(void) { } weak_alias(dummy, __vm_wait); @@ -39,4 +38,4 @@ void *__mmap(void *start, size_t len, int prot, int flags, int fd, off_t off) weak_alias(__mmap, mmap); -LFS64(mmap); +weak_alias(mmap, mmap64); diff --git a/src/regex/glob.c b/src/regex/glob.c index 8567198..746da77 100644 --- a/src/regex/glob.c +++ b/src/regex/glob.c @@ -7,7 +7,6 @@ #include #include #include -#include "libc.h" struct match { @@ -240,5 +239,5 @@ void globfree(glob_t *g) g->gl_pathv = NULL; } -LFS64(glob); -LFS64(globfree); +weak_alias(glob, glob64); +weak_alias(globfree, globfree64); diff --git a/src/stat/__xstat.c b/src/stat/__xstat.c index 73c873a..f630343 100644 --- a/src/stat/__xstat.c +++ b/src/stat/__xstat.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int __fxstat(int ver, int fd, struct stat *buf) { @@ -21,10 +20,10 @@ int __xstat(int ver, const char *path, struct stat *buf) return stat(path, buf); } -LFS64(__fxstat); -LFS64(__fxstatat); -LFS64(__lxstat); -LFS64(__xstat); +weak_alias(__fxstat, __fxstat64); +weak_alias(__fxstatat, __fxstatat64); +weak_alias(__lxstat, __lxstat64); +weak_alias(__xstat, __xstat64); int __xmknod(int ver, const char *path, mode_t mode, dev_t *dev) { diff --git a/src/stat/fstat.c b/src/stat/fstat.c index f6d1652..4f13f4f 100644 --- a/src/stat/fstat.c +++ b/src/stat/fstat.c @@ -2,7 +2,6 @@ #include #include #include "syscall.h" -#include "libc.h" int fstat(int fd, struct stat *st) { @@ -19,4 +18,4 @@ int fstat(int fd, struct stat *st) #endif } -LFS64(fstat); +weak_alias(fstat, fstat64); diff --git a/src/stat/fstatat.c b/src/stat/fstatat.c index 863d526..582db44 100644 --- a/src/stat/fstatat.c +++ b/src/stat/fstatat.c @@ -1,10 +1,9 @@ #include #include "syscall.h" -#include "libc.h" int fstatat(int fd, const char *restrict path, struct stat *restrict buf, int flag) { return syscall(SYS_fstatat, fd, path, buf, flag); } -LFS64(fstatat); +weak_alias(fstatat, fstatat64); diff --git a/src/stat/lstat.c b/src/stat/lstat.c index 5e8b84f..5b89f29 100644 --- a/src/stat/lstat.c +++ b/src/stat/lstat.c @@ -1,7 +1,6 @@ #include #include #include "syscall.h" -#include "libc.h" int lstat(const char *restrict path, struct stat *restrict buf) { @@ -12,4 +11,4 @@ int lstat(const char *restrict path, struct stat *restrict buf) #endif } -LFS64(lstat); +weak_alias(lstat, lstat64); diff --git a/src/stat/stat.c b/src/stat/stat.c index b4433a0..0bec9d6 100644 --- a/src/stat/stat.c +++ b/src/stat/stat.c @@ -1,7 +1,6 @@ #include #include #include "syscall.h" -#include "libc.h" int stat(const char *restrict path, struct stat *restrict buf) { @@ -12,4 +11,4 @@ int stat(const char *restrict path, struct stat *restrict buf) #endif } -LFS64(stat); +weak_alias(stat, stat64); diff --git a/src/stat/statvfs.c b/src/stat/statvfs.c index 66b9512..f65d1b5 100644 --- a/src/stat/statvfs.c +++ b/src/stat/statvfs.c @@ -1,7 +1,6 @@ #include #include #include "syscall.h" -#include "libc.h" static int __statfs(const char *path, struct statfs *buf) { @@ -58,7 +57,7 @@ int fstatvfs(int fd, struct statvfs *buf) return 0; } -LFS64(statvfs); -LFS64(statfs); -LFS64(fstatvfs); -LFS64(fstatfs); +weak_alias(statvfs, statvfs64); +weak_alias(statfs, statfs64); +weak_alias(fstatvfs, fstatvfs64); +weak_alias(fstatfs, fstatfs64); diff --git a/src/stdio/fgetpos.c b/src/stdio/fgetpos.c index 6b45f57..50813d2 100644 --- a/src/stdio/fgetpos.c +++ b/src/stdio/fgetpos.c @@ -1,5 +1,4 @@ #include "stdio_impl.h" -#include "libc.h" int fgetpos(FILE *restrict f, fpos_t *restrict pos) { @@ -9,4 +8,4 @@ int fgetpos(FILE *restrict f, fpos_t *restrict pos) return 0; } -LFS64(fgetpos); +weak_alias(fgetpos, fgetpos64); diff --git a/src/stdio/fopen.c b/src/stdio/fopen.c index 2a20c7f..e1b91e1 100644 --- a/src/stdio/fopen.c +++ b/src/stdio/fopen.c @@ -2,7 +2,6 @@ #include #include #include -#include "libc.h" FILE *fopen(const char *restrict filename, const char *restrict mode) { @@ -31,4 +30,4 @@ FILE *fopen(const char *restrict filename, const char *restrict mode) return 0; } -LFS64(fopen); +weak_alias(fopen, fopen64); diff --git a/src/stdio/freopen.c b/src/stdio/freopen.c index 6d6d21d..615d4b4 100644 --- a/src/stdio/freopen.c +++ b/src/stdio/freopen.c @@ -1,7 +1,6 @@ #include "stdio_impl.h" #include #include -#include "libc.h" /* The basic idea of this implementation is to open a new FILE, * hack the necessary parts of the new FILE into the old one, then @@ -51,4 +50,4 @@ fail: return NULL; } -LFS64(freopen); +weak_alias(freopen, freopen64); diff --git a/src/stdio/fseek.c b/src/stdio/fseek.c index 26d9f7e..67d75f7 100644 --- a/src/stdio/fseek.c +++ b/src/stdio/fseek.c @@ -1,5 +1,4 @@ #include "stdio_impl.h" -#include "libc.h" int __fseeko_unlocked(FILE *f, off_t off, int whence) { @@ -41,4 +40,4 @@ int fseek(FILE *f, long off, int whence) weak_alias(__fseeko, fseeko); -LFS64(fseeko); +weak_alias(fseeko, fseeko64); diff --git a/src/stdio/fsetpos.c b/src/stdio/fsetpos.c index cea5ddb..77ab8d8 100644 --- a/src/stdio/fsetpos.c +++ b/src/stdio/fsetpos.c @@ -1,9 +1,8 @@ #include "stdio_impl.h" -#include "libc.h" int fsetpos(FILE *f, const fpos_t *pos) { return __fseeko(f, *(const long long *)pos, SEEK_SET); } -LFS64(fsetpos); +weak_alias(fsetpos, fsetpos64); diff --git a/src/stdio/ftell.c b/src/stdio/ftell.c index aad352b..5ca4165 100644 --- a/src/stdio/ftell.c +++ b/src/stdio/ftell.c @@ -1,7 +1,6 @@ #include "stdio_impl.h" #include #include -#include "libc.h" off_t __ftello_unlocked(FILE *f) { @@ -35,4 +34,4 @@ long ftell(FILE *f) weak_alias(__ftello, ftello); -LFS64(ftello); +weak_alias(ftello, ftello64); diff --git a/src/stdio/tmpfile.c b/src/stdio/tmpfile.c index 7013f64..ae49398 100644 --- a/src/stdio/tmpfile.c +++ b/src/stdio/tmpfile.c @@ -2,7 +2,6 @@ #include #include #include "stdio_impl.h" -#include "libc.h" #define MAXTRIES 100 @@ -29,4 +28,4 @@ FILE *tmpfile(void) return 0; } -LFS64(tmpfile); +weak_alias(tmpfile, tmpfile64); diff --git a/src/temp/mkostemp.c b/src/temp/mkostemp.c index 4fe5713..d8dcb80 100644 --- a/src/temp/mkostemp.c +++ b/src/temp/mkostemp.c @@ -1,10 +1,9 @@ #define _BSD_SOURCE #include -#include "libc.h" int mkostemp(char *template, int flags) { return __mkostemps(template, 0, flags); } -LFS64(mkostemp); +weak_alias(mkostemp, mkostemp64); diff --git a/src/temp/mkstemp.c b/src/temp/mkstemp.c index 19d4014..166b8af 100644 --- a/src/temp/mkstemp.c +++ b/src/temp/mkstemp.c @@ -1,9 +1,8 @@ #include -#include "libc.h" int mkstemp(char *template) { return __mkostemps(template, 0, 0); } -LFS64(mkstemp); +weak_alias(mkstemp, mkstemp64); diff --git a/src/temp/mkstemps.c b/src/temp/mkstemps.c index f2ab1bd..6b7531b 100644 --- a/src/temp/mkstemps.c +++ b/src/temp/mkstemps.c @@ -1,10 +1,9 @@ #define _BSD_SOURCE #include -#include "libc.h" int mkstemps(char *template, int len) { return __mkostemps(template, len, 0); } -LFS64(mkstemps); +weak_alias(mkstemps, mkstemps64); diff --git a/src/unistd/ftruncate.c b/src/unistd/ftruncate.c index 467135f..b41be0f 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 0a5ed39..bf8cd85 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 5483eb9..5681b04 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 46d9ece..8376d60 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 4bf3d7d..ca37657 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 aec5d32..f5a612c 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 8e65655..9729680 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.1