diff options
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | io/fcntl.h | 6 | ||||
-rw-r--r-- | sysdeps/generic/posix_fallocate.c | 4 | ||||
-rw-r--r-- | sysdeps/generic/posix_fallocate64.c | 4 | ||||
-rw-r--r-- | sysdeps/posix/posix_fallocate.c | 6 | ||||
-rw-r--r-- | sysdeps/posix/posix_fallocate64.c | 24 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/Versions | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-32/Versions | 3 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/Versions | 2 |
10 files changed, 51 insertions, 18 deletions
@@ -1,3 +1,19 @@ +2003-08-22 Ulrich Drepper <drepper@redhat.com> + + * io/fcntl.h (posix_fallocate): Change type of third parameter to + off_t. + (posix_fallocate64): Change type of third parameter to off64_t. + * sysdeps/generic/posix_fallocate.c: Adjust for type change. + * sysdeps/posix/posix_fallocate.c: Likewise. + * sysdeps/generic/posix_fallocate64.c: Likewise. + * sysdeps/posix/posix_fallocate64.c: Likewise. Add compatibility + code for 32-bit platforms. + * sysdeps/unix/sysv/linux/i386/Versions: Add new version for + posix_fallocate64. + * sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/Versions: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/Versions: Likewise. + 2003-08-19 Ulrich Drepper <drepper@redhat.com> * string/bits/string2.h (__STRING2_COPY_TYPE): Add attribute to diff --git a/io/fcntl.h b/io/fcntl.h index 97ef27b735..d702368b30 100644 --- a/io/fcntl.h +++ b/io/fcntl.h @@ -156,18 +156,18 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len, This function is a possible cancellation points and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 -extern int posix_fallocate (int __fd, __off_t __offset, size_t __len); +extern int posix_fallocate (int __fd, __off_t __offset, __off_t __len); # else # ifdef __REDIRECT extern int __REDIRECT (posix_fallocate, (int __fd, __off64_t __offset, - size_t __len), + __off64_t __len), posix_fallocate64); # else # define posix_fallocate posix_fallocate64 # endif # endif # ifdef __USE_LARGEFILE64 -extern int posix_fallocate64 (int __fd, __off64_t __offset, size_t __len); +extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len); # endif #endif diff --git a/sysdeps/generic/posix_fallocate.c b/sysdeps/generic/posix_fallocate.c index 2243a458e5..218b4adbe3 100644 --- a/sysdeps/generic/posix_fallocate.c +++ b/sysdeps/generic/posix_fallocate.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,7 +22,7 @@ /* Reserve storage for the data of the file associated with FD. */ int -posix_fallocate (int fd, __off_t offset, size_t len) +posix_fallocate (int fd, __off_t offset, __off_t len) { __set_errno (ENOSYS); return -1; diff --git a/sysdeps/generic/posix_fallocate64.c b/sysdeps/generic/posix_fallocate64.c index 5074a90bfa..80c1cd385d 100644 --- a/sysdeps/generic/posix_fallocate64.c +++ b/sysdeps/generic/posix_fallocate64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,7 +22,7 @@ /* Reserve storage for the data of the file associated with FD. */ int -posix_fallocate64 (int fd, __off64_t offset, size_t len) +posix_fallocate64 (int fd, __off64_t offset, __off64_t len) { __set_errno (ENOSYS); return -1; diff --git a/sysdeps/posix/posix_fallocate.c b/sysdeps/posix/posix_fallocate.c index 955cf2e127..838e7a004a 100644 --- a/sysdeps/posix/posix_fallocate.c +++ b/sysdeps/posix/posix_fallocate.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,7 +25,7 @@ /* Reserve storage for the data of the file associated with FD. */ int -posix_fallocate (int fd, __off_t offset, size_t len) +posix_fallocate (int fd, __off_t offset, __off_t len) { struct stat64 st; struct statfs f; @@ -33,7 +33,7 @@ posix_fallocate (int fd, __off_t offset, size_t len) /* `off_tī is a signed type. Therefore we can determine whether OFFSET + LEN is too large if it is a negative value. */ - if (offset < 0 || len == 0) + if (offset < 0 || len < 0) return EINVAL; if (offset + len < 0) return EFBIG; diff --git a/sysdeps/posix/posix_fallocate64.c b/sysdeps/posix/posix_fallocate64.c index 7aa8672408..e5fb18d549 100644 --- a/sysdeps/posix/posix_fallocate64.c +++ b/sysdeps/posix/posix_fallocate64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,7 +25,7 @@ /* Reserve storage for the data of the file associated with FD. */ int -posix_fallocate64 (int fd, __off64_t offset, size_t len) +__posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len) { struct stat64 st; struct statfs64 f; @@ -33,7 +33,7 @@ posix_fallocate64 (int fd, __off64_t offset, size_t len) /* `off64_tī is a signed type. Therefore we can determine whether OFFSET + LEN is too large if it is a negative value. */ - if (offset < 0 || len == 0) + if (offset < 0 || len < 0) return EINVAL; if (offset + len < 0) return EFBIG; @@ -69,3 +69,21 @@ posix_fallocate64 (int fd, __off64_t offset, size_t len) return 0; } + +#include <shlib-compat.h> +#include <bits/wordsize.h> + +#if __WORDSIZE == 32 && SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3) + +int +__posix_fallocate64_l32 (int fd, off64_t offset, size_t len) +{ + return __posix_fallocate64_l64 (fd, offset, len); +} + +versioned_symbol (libc, __posix_fallocate64_l64, posix_fallocate64, + GLIBC_2_3_3); +compat_symbol (libc, __posix_fallocate64_l32, posix_fallocate64, GLIBC_2_2); +#else +strong_alias (__posix_fallocate64_l64, posix_fallocate64); +#endif diff --git a/sysdeps/unix/sysv/linux/i386/Versions b/sysdeps/unix/sysv/linux/i386/Versions index 1abb39741c..ef3c855089 100644 --- a/sysdeps/unix/sysv/linux/i386/Versions +++ b/sysdeps/unix/sysv/linux/i386/Versions @@ -34,7 +34,7 @@ libc { versionsort64; } GLIBC_2.3.3 { - posix_fadvise64; + posix_fadvise64; posix_fallocate64; } GLIBC_PRIVATE { __modify_ldt; diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions index 6d0795817f..92158ee1b5 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions @@ -21,6 +21,6 @@ libc { scandir64; } GLIBC_2.3.3 { - posix_fadvise64; + posix_fadvise64; posix_fallocate64; } } diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/Versions b/sysdeps/unix/sysv/linux/s390/s390-32/Versions index da461a57a0..8d6a660cb5 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/Versions +++ b/sysdeps/unix/sysv/linux/s390/s390-32/Versions @@ -24,7 +24,6 @@ libc { versionsort64; } GLIBC_2.3.3 { - posix_fadvise64; + posix_fadvise64; posix_fallocate64; } } - diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/Versions b/sysdeps/unix/sysv/linux/sparc/sparc32/Versions index e6903728f3..c585af3602 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/Versions +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/Versions @@ -18,6 +18,6 @@ libc { scandir64; } GLIBC_2.3.3 { - posix_fadvise64; + posix_fadvise64; posix_fallocate64; } } |