diff options
Diffstat (limited to 'libc/sysdeps/linux/common')
26 files changed, 41 insertions, 81 deletions
diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index 3855e8505..257ed7222 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -13,7 +13,7 @@ CSRC- := ssp-local.c CSRC_LFS := $(notdir $(wildcard $(COMMON_DIR)/*64.c)) CSRC-y := $(filter-out llseek.c $(CSRC_LFS),$(CSRC-y)) -CSRC-$(UCLIBC_HAS_LFS) += llseek.c $(CSRC_LFS) +CSRC-y += llseek.c $(CSRC_LFS) CSRC-$(findstring y,$(UCLIBC_HAS_SSP)$(UCLIBC_HAS_FORTIFY)) += ssp.c CSRC-$(UCLIBC_LINUX_MODULE_26) += delete_module.c init_module.c # we need these internally: fstatfs.c statfs.c @@ -65,8 +65,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \ uselib.c \ vhangup.c \ vmsplice.c -CSRC-$(if $(findstring yy,$(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_LFS)),y) += \ - sendfile64.c +CSRC-$(UCLIBC_LINUX_SPECIFIC) += sendfile64.c # posix_fallocate() needs __libc_fallocate() from fallocate.c # posix_fallocate64() needs __libc_fallocate64() from fallocate64.c CSRC-$(if $(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_ADVANCED_REALTIME),y,) += \ diff --git a/libc/sysdeps/linux/common/__syscall_fcntl.c b/libc/sysdeps/linux/common/__syscall_fcntl.c index 86cc60d1a..909b0a061 100644 --- a/libc/sysdeps/linux/common/__syscall_fcntl.c +++ b/libc/sysdeps/linux/common/__syscall_fcntl.c @@ -18,7 +18,7 @@ int __NC(fcntl)(int fd, int cmd, long arg) { #if __WORDSIZE == 32 if (cmd == F_GETLK64 || cmd == F_SETLK64 || cmd == F_SETLKW64) { -# if (defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64) || !defined __NR_fcntl +# if defined __NR_fcntl64 || !defined __NR_fcntl return INLINE_SYSCALL(fcntl64, 3, fd, cmd, arg); # else __set_errno(ENOSYS); @@ -66,7 +66,7 @@ int fcntl(int fd, int cmd, ...) } lt_strong_alias(fcntl) lt_libc_hidden(fcntl) -#if defined __UCLIBC_HAS_LFS__ && !defined __NR_fcntl64 && __WORDSIZE == 32 +#if !defined __NR_fcntl64 && __WORDSIZE == 32 strong_alias_untyped(fcntl,fcntl64) lt_strong_alias(fcntl64) lt_libc_hidden(fcntl64) diff --git a/libc/sysdeps/linux/common/bits/uClibc_posix_opt.h b/libc/sysdeps/linux/common/bits/uClibc_posix_opt.h index 0ae0da188..6ec7da3de 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_posix_opt.h +++ b/libc/sysdeps/linux/common/bits/uClibc_posix_opt.h @@ -110,13 +110,6 @@ # undef _POSIX_MEMORY_PROTECTION #endif -#ifndef __UCLIBC_HAS_LFS__ -# undef _LFS64_ASYNCHRONOUS_IO -# undef _LFS_LARGEFILE -# undef _LFS64_LARGEFILE -# undef _LFS64_STDIO -#endif - #ifndef __UCLIBC_HAS_REALTIME__ # undef _POSIX_SEMAPHORES #endif diff --git a/libc/sysdeps/linux/common/bits/uClibc_stdio.h b/libc/sysdeps/linux/common/bits/uClibc_stdio.h index efd8a6c89..6222cebee 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_stdio.h +++ b/libc/sysdeps/linux/common/bits/uClibc_stdio.h @@ -151,7 +151,6 @@ typedef struct { #endif } __STDIO_fpos_t; -#ifdef __UCLIBC_HAS_LFS__ typedef struct { __off64_t __pos; #ifdef __STDIO_MBSTATE @@ -161,14 +160,9 @@ typedef struct { int __mblen_pending; #endif } __STDIO_fpos64_t; -#endif /**********************************************************************/ -#ifdef __UCLIBC_HAS_LFS__ typedef __off64_t __offmax_t; /* TODO -- rename this? */ -#else -typedef __off_t __offmax_t; /* TODO -- rename this? */ -#endif /**********************************************************************/ #ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__ diff --git a/libc/sysdeps/linux/common/fstat.c b/libc/sysdeps/linux/common/fstat.c index 696f79ea7..eae3c8006 100644 --- a/libc/sysdeps/linux/common/fstat.c +++ b/libc/sysdeps/linux/common/fstat.c @@ -56,7 +56,7 @@ int fstat(int fd, struct stat *buf) } libc_hidden_def(fstat) -# if ! defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__ +# if ! defined __NR_fstat64 strong_alias_untyped(fstat,fstat64) libc_hidden_def(fstat64) # endif diff --git a/libc/sysdeps/linux/common/ftruncate.c b/libc/sysdeps/linux/common/ftruncate.c index 96076e449..8637ee830 100644 --- a/libc/sysdeps/linux/common/ftruncate.c +++ b/libc/sysdeps/linux/common/ftruncate.c @@ -15,10 +15,10 @@ # include <stdint.h> int ftruncate(int fd, __off_t length) { -# if defined __UCLIBC_HAS_LFS__ - return ftruncate64(fd, length); -# elif __WORDSIZE == 32 +# if __WORDSIZE == 32 return INLINE_SYSCALL(ftruncate64, 3, fd, OFF_HI_LO(length)); +# else + return ftruncate64(fd, length); # endif } libc_hidden_def(ftruncate); diff --git a/libc/sysdeps/linux/common/getdents.c b/libc/sysdeps/linux/common/getdents.c index 8f371eba4..6a5389ec8 100644 --- a/libc/sysdeps/linux/common/getdents.c +++ b/libc/sysdeps/linux/common/getdents.c @@ -7,7 +7,7 @@ #include <sys/syscall.h> #include <bits/wordsize.h> -#if !(defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64 && __WORDSIZE == 64) +#if !(defined __NR_getdents64 && __WORDSIZE == 64) #include <dirent.h> #include <string.h> @@ -72,7 +72,7 @@ ssize_t __getdents (int fd, char *buf, size_t nbytes) return retval; } -# elif ! defined __UCLIBC_HAS_LFS__ || !defined __NR_getdents64 +# elif !defined __NR_getdents64 # include <assert.h> # include <stddef.h> @@ -187,7 +187,7 @@ ssize_t __getdents (int fd, char *buf, size_t nbytes) # endif -# if defined __UCLIBC_HAS_LFS__ && ! defined __NR_getdents64 +# if ! defined __NR_getdents64 strong_alias(__getdents,__getdents64) # endif diff --git a/libc/sysdeps/linux/common/getdents64.c b/libc/sysdeps/linux/common/getdents64.c index 017fa63c1..d4bc14b5f 100644 --- a/libc/sysdeps/linux/common/getdents64.c +++ b/libc/sysdeps/linux/common/getdents64.c @@ -91,7 +91,7 @@ ssize_t __getdents64 (int fd, char *buf, size_t nbytes) return (char *) dp - buf; } -#if __WORDSIZE == 64 || (defined __UCLIBC_HAS_LFS__ && !defined __NR_getdents) +#if __WORDSIZE == 64 || !defined __NR_getdents /* since getdents doesnt give us d_type but getdents64 does, try and * use getdents64 as much as possible */ strong_alias(__getdents64,__getdents) diff --git a/libc/sysdeps/linux/common/getdirname.c b/libc/sysdeps/linux/common/getdirname.c index 862559a2e..7153cd1e0 100644 --- a/libc/sysdeps/linux/common/getdirname.c +++ b/libc/sysdeps/linux/common/getdirname.c @@ -32,21 +32,12 @@ char * get_current_dir_name (void) { char *pwd; -#ifdef __UCLIBC_HAS_LFS__ struct stat64 dotstat, pwdstat; -#else - struct stat dotstat, pwdstat; -#endif pwd = getenv ("PWD"); if (pwd != NULL -#ifdef __UCLIBC_HAS_LFS__ && stat64 (".", &dotstat) == 0 && stat64 (pwd, &pwdstat) == 0 -#else - && stat (".", &dotstat) == 0 - && stat (pwd, &pwdstat) == 0 -#endif && pwdstat.st_dev == dotstat.st_dev && pwdstat.st_ino == dotstat.st_ino) /* The PWD value is correct. Use it. */ diff --git a/libc/sysdeps/linux/common/getrlimit.c b/libc/sysdeps/linux/common/getrlimit.c index 3b2ce3b37..8091e56de 100644 --- a/libc/sysdeps/linux/common/getrlimit.c +++ b/libc/sysdeps/linux/common/getrlimit.c @@ -58,6 +58,6 @@ int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) #endif libc_hidden_def(getrlimit) -#if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64 +#if __WORDSIZE == 64 strong_alias_untyped(getrlimit, getrlimit64) #endif diff --git a/libc/sysdeps/linux/common/lseek.c b/libc/sysdeps/linux/common/lseek.c index 11a1fbb3e..cbebbaec5 100644 --- a/libc/sysdeps/linux/common/lseek.c +++ b/libc/sysdeps/linux/common/lseek.c @@ -14,17 +14,16 @@ #ifdef __NR_lseek # define __NR___lseek_nocancel __NR_lseek _syscall3(off_t, __NC(lseek), int, fd, off_t, offset, int, whence) -/* Use lseek64 if __NR_lseek is not defined but UCLIBC_HAS_LFS is enabled */ #elif !defined __NR_lseek && defined __NR_llseek #include <endian.h> off_t __NC(lseek)(int fd, off_t offset, int whence) { -#if defined __UCLIBC_HAS_LFS__ - return lseek64(fd, offset, whence); -#elif __WORDSIZE == 32 +#if __WORDSIZE == 32 __off64_t result; __off_t high = 0; return INLINE_SYSCALL(llseek, 5, fd, high, offset, &result, whence) ?: result; +#else + return lseek64(fd, offset, whence); #endif /* No need to handle __WORDSIZE == 64 as such a kernel won't define __NR_llseek */ } @@ -53,7 +52,7 @@ off_t __NC(lseek)(int fd, off_t offset attribute_unused, int whence) #endif CANCELLABLE_SYSCALL(off_t, lseek, (int fd, off_t offset, int whence), (fd, offset, whence)) lt_libc_hidden(lseek) -#if defined __UCLIBC_HAS_LFS__ && (__WORDSIZE == 64 || (!defined __NR__llseek && !defined __NR_llseek)) +#if __WORDSIZE == 64 || (!defined __NR__llseek && !defined __NR_llseek) strong_alias_untyped(__NC(lseek),__NC(lseek64)) strong_alias_untyped(lseek,lseek64) lt_strong_alias(lseek64) diff --git a/libc/sysdeps/linux/common/lstat.c b/libc/sysdeps/linux/common/lstat.c index 2fa3de1c2..143cc1916 100644 --- a/libc/sysdeps/linux/common/lstat.c +++ b/libc/sysdeps/linux/common/lstat.c @@ -49,8 +49,7 @@ int lstat(const char *file_name, struct stat *buf) } libc_hidden_def(lstat) -# if ! defined __NR_fstatat64 && ! defined __NR_lstat64 \ - && defined __UCLIBC_HAS_LFS__ +# if ! defined __NR_fstatat64 && ! defined __NR_lstat64 strong_alias_untyped(lstat,lstat64) libc_hidden_def(lstat64) # endif diff --git a/libc/sysdeps/linux/common/posix_fadvise.c b/libc/sysdeps/linux/common/posix_fadvise.c index 74d8409c0..c4ebeaa31 100644 --- a/libc/sysdeps/linux/common/posix_fadvise.c +++ b/libc/sysdeps/linux/common/posix_fadvise.c @@ -22,7 +22,7 @@ # include <endian.h> # include <bits/wordsize.h> -# if defined(__NR_fadvise64_64) && defined(__UCLIBC_HAS_LFS__) +# if defined(__NR_fadvise64_64) #include <_lfs_64.h> int posix_fadvise64(int fd, off64_t offset, off64_t len, int advice); @@ -73,7 +73,7 @@ int posix_fadvise(int fd, off_t offset, off_t len, int advice) return INTERNAL_SYSCALL_ERRNO (ret, err); return 0; } -# if defined __UCLIBC_HAS_LFS__ && (!defined __NR_fadvise64_64 || __WORDSIZE == 64) +# if !defined __NR_fadvise64_64 || __WORDSIZE == 64 strong_alias(posix_fadvise,posix_fadvise64) # endif #endif diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c index 2316cfdcd..0f1632f78 100644 --- a/libc/sysdeps/linux/common/posix_fallocate.c +++ b/libc/sysdeps/linux/common/posix_fallocate.c @@ -22,7 +22,7 @@ int posix_fallocate(int fd, __off_t offset, __off_t len) return errno; return 0; } -# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64 +# if __WORDSIZE == 64 strong_alias(posix_fallocate,posix_fallocate64) # endif #endif diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c index d0abd90e4..cb2e325e9 100644 --- a/libc/sysdeps/linux/common/pread_write.c +++ b/libc/sysdeps/linux/common/pread_write.c @@ -86,8 +86,7 @@ static ssize_t __NC(pwrite)(int fd, const void *buf, size_t count, off_t offset) CANCELLABLE_SYSCALL(ssize_t, pwrite, (int fd, const void *buf, size_t count, off_t offset), (fd, buf, count, offset)) -#ifdef __UCLIBC_HAS_LFS__ -# if __WORDSIZE == 32 +#if __WORDSIZE == 32 static ssize_t __NC(pread64)(int fd, void *buf, size_t count, off64_t offset) { return MY_PREAD64(fd, buf, count, offset); @@ -101,15 +100,14 @@ static ssize_t __NC(pwrite64)(int fd, const void *buf, size_t count, off64_t off } CANCELLABLE_SYSCALL(ssize_t, pwrite64, (int fd, const void *buf, size_t count, off64_t offset), (fd, buf, count, offset)) -# else -# ifdef __UCLIBC_HAS_LINUXTHREADS__ +#else +# ifdef __UCLIBC_HAS_LINUXTHREADS__ weak_alias(pread,pread64) weak_alias(pwrite,pwrite64) lt_strong_alias(pread64) lt_strong_alias(pwrite64) -# else +# else strong_alias_untyped(pread,pread64) strong_alias_untyped(pwrite,pwrite64) -# endif # endif #endif diff --git a/libc/sysdeps/linux/common/readahead.c b/libc/sysdeps/linux/common/readahead.c index bda0de2c7..f45be75c9 100644 --- a/libc/sysdeps/linux/common/readahead.c +++ b/libc/sysdeps/linux/common/readahead.c @@ -18,7 +18,7 @@ #include <sys/syscall.h> -#if defined __NR_readahead && defined __UCLIBC_HAS_LFS__ && defined __USE_GNU +#if defined __NR_readahead && defined __USE_GNU # include <fcntl.h> # include <bits/wordsize.h> diff --git a/libc/sysdeps/linux/common/sendfile.c b/libc/sysdeps/linux/common/sendfile.c index 2f4887145..cca80abc7 100644 --- a/libc/sysdeps/linux/common/sendfile.c +++ b/libc/sysdeps/linux/common/sendfile.c @@ -15,7 +15,7 @@ #if defined __NR_sendfile _syscall4(ssize_t, sendfile, int, out_fd, int, in_fd, __off_t *, offset, size_t, count) -# if defined __UCLIBC_HAS_LFS__ && (!defined __NR_sendfile64 || __WORDSIZE == 64) +# if !defined __NR_sendfile64 || __WORDSIZE == 64 libc_hidden_def(sendfile64) strong_alias_untyped(sendfile,sendfile64) # endif diff --git a/libc/sysdeps/linux/common/setrlimit.c b/libc/sysdeps/linux/common/setrlimit.c index d96700aec..cc4f6717b 100644 --- a/libc/sysdeps/linux/common/setrlimit.c +++ b/libc/sysdeps/linux/common/setrlimit.c @@ -63,6 +63,6 @@ int setrlimit(__rlimit_resource_t resource, const struct rlimit *rlimits) #endif libc_hidden_def(setrlimit) -#if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64 +#if __WORDSIZE == 64 strong_alias_untyped(setrlimit, setrlimit64) #endif diff --git a/libc/sysdeps/linux/common/splice.c b/libc/sysdeps/linux/common/splice.c index 4a32c54a8..edf9314eb 100644 --- a/libc/sysdeps/linux/common/splice.c +++ b/libc/sysdeps/linux/common/splice.c @@ -9,7 +9,7 @@ #include <sys/syscall.h> -#if defined __NR_splice && defined __UCLIBC_HAS_LFS__ && defined __USE_GNU +#if defined __NR_splice && defined __USE_GNU # include <fcntl.h> _syscall6(ssize_t, splice, int, __fdin, off64_t *, __offin, int, __fdout, diff --git a/libc/sysdeps/linux/common/stat.c b/libc/sysdeps/linux/common/stat.c index c7e213838..b3c2a19ea 100644 --- a/libc/sysdeps/linux/common/stat.c +++ b/libc/sysdeps/linux/common/stat.c @@ -51,8 +51,7 @@ int stat(const char *file_name, struct stat *buf) #endif /* __NR_fstat64 */ libc_hidden_def(stat) -#if ! defined __NR_stat64 && ! defined __NR_fstatat64 && \ - defined __UCLIBC_HAS_LFS__ +#if ! defined __NR_stat64 && ! defined __NR_fstatat64 strong_alias_untyped(stat,stat64) libc_hidden_def(stat64) #endif diff --git a/libc/sysdeps/linux/common/stat64.c b/libc/sysdeps/linux/common/stat64.c index cb3a0e169..736125fc9 100644 --- a/libc/sysdeps/linux/common/stat64.c +++ b/libc/sysdeps/linux/common/stat64.c @@ -11,11 +11,9 @@ #include <sys/syscall.h> #include <sys/stat.h> -#if defined __UCLIBC_HAS_LFS__ - -# if defined __NR_fstatat64 && !defined __NR_stat64 -# include <fcntl.h> -# include <unistd.h> +#if defined __NR_fstatat64 && !defined __NR_stat64 +#include <fcntl.h> +#include <unistd.h> int stat64(const char *file_name, struct stat64 *buf) { @@ -42,6 +40,4 @@ int stat64(const char *file_name, struct stat64 *buf) return result; } libc_hidden_def(stat64) -# endif - -#endif /* __UCLIBC_HAS_LFS__ */ +#endif diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c index b80b54b2c..e7e81daaf 100644 --- a/libc/sysdeps/linux/common/stubs.c +++ b/libc/sysdeps/linux/common/stubs.c @@ -232,9 +232,7 @@ make_stub(modify_ldt) #ifndef __NR_openat make_stub(openat) -# ifdef __UCLIBC_HAS_LFS__ make_stub(openat64) -# endif #endif #if !defined __NR_personality && defined __UCLIBC_LINUX_SPECIFIC__ @@ -249,11 +247,11 @@ make_stub(pipe2) make_stub(pivot_root) #endif -#if !defined __NR_fadvise64 && defined __UCLIBC_HAS_LFS__ +#if !defined __NR_fadvise64 make_ret_stub(posix_fadvise) #endif -#if !defined __NR_fadvise64_64 && defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 32 +#if !defined __NR_fadvise64_64 && __WORDSIZE == 32 make_ret_stub(posix_fadvise64) #endif @@ -322,7 +320,7 @@ make_stub(send) make_stub(sendfile) #endif -#if !defined __NR_sendfile64 && !defined __NR_sendfile && defined __UCLIBC_LINUX_SPECIFIC__ && defined __UCLIBC_HAS_LFS__ +#if !defined __NR_sendfile64 && !defined __NR_sendfile && defined __UCLIBC_LINUX_SPECIFIC__ make_stub(sendfile64) #endif diff --git a/libc/sysdeps/linux/common/sync_file_range.c b/libc/sysdeps/linux/common/sync_file_range.c index 52bc9d7af..ed03d2f85 100644 --- a/libc/sysdeps/linux/common/sync_file_range.c +++ b/libc/sysdeps/linux/common/sync_file_range.c @@ -8,7 +8,7 @@ */ #include <sys/syscall.h> -#if defined __UCLIBC_HAS_LFS__ && defined __USE_GNU +#if defined __USE_GNU # include <bits/wordsize.h> # include <endian.h> # include <fcntl.h> diff --git a/libc/sysdeps/linux/common/truncate.c b/libc/sysdeps/linux/common/truncate.c index 5cbf67351..48514c2a4 100644 --- a/libc/sysdeps/linux/common/truncate.c +++ b/libc/sysdeps/linux/common/truncate.c @@ -16,14 +16,14 @@ int truncate(const char *path, __off_t length) { -# if defined __UCLIBC_HAS_LFS - return truncate64(path, length); -# elif __WORDSIZE == 32 +# if __WORDSIZE == 32 # if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__) return INLINE_SYSCALL(truncate64, 4, path, 0, OFF_HI_LO(length)); # else return INLINE_SYSCALL(truncate64, 3, path, OFF_HI_LO(length)); # endif +# else + return truncate64(path, length); # endif } libc_hidden_def(truncate); diff --git a/libc/sysdeps/linux/common/xstatconv.c b/libc/sysdeps/linux/common/xstatconv.c index a21579c41..d50fbf9c3 100644 --- a/libc/sysdeps/linux/common/xstatconv.c +++ b/libc/sysdeps/linux/common/xstatconv.c @@ -67,8 +67,6 @@ void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf) buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec; } -#ifdef __UCLIBC_HAS_LFS__ - void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf) { /* Convert to current kernel version of `struct stat64'. */ @@ -93,5 +91,3 @@ void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf) buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec; buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec; } - -#endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/sysdeps/linux/common/xstatconv.h b/libc/sysdeps/linux/common/xstatconv.h index cd4d7e9cf..7c86c2edc 100644 --- a/libc/sysdeps/linux/common/xstatconv.h +++ b/libc/sysdeps/linux/common/xstatconv.h @@ -28,8 +28,6 @@ #ifdef __ARCH_HAS_DEPRECATED_SYSCALLS__ extern void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf) attribute_hidden; extern void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf) attribute_hidden; -#if defined __UCLIBC_HAS_LFS__ extern void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf) attribute_hidden; #endif -#endif |