Re: [Linux PATCH] fcntl: add new F_OFD_*32 constants and handle them appropriately

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Zack Weinberg wrote:
We could change the libc headers used on old-ILP32 ABIs so that
_FILE_OFFSET_BITS=64 is defined by default (matching the LP64-ABI
headers).  This would break the ABI of every shared library that
exports a structure (transitively) containing a field of type off_t,
ino_t, fsblkcnt_t, fsfilcnt_t, or rlim_t.

As I understand it, most (all important?) such libraries are already compiled with _FILE_OFFSET_BITS=64 anyway, so their ABIs wouldn't break.

How about if we start the transition by deprecating the use of 32-bit off_t in user or library code on platforms with 32-bit long? The attached patch plus lots of similar patches, say (this is just a sketch). Really, it's long since time that file offsets were 64 bits.
diff --git a/libio/stdio.h b/libio/stdio.h
index e37f901..a5f65e9 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -88,7 +88,11 @@ typedef _G_va_list va_list;
 #if defined __USE_UNIX98 || defined __USE_XOPEN2K
 # ifndef __off_t_defined
 # ifndef __USE_FILE_OFFSET64
+#  if !_SUPPRESS_FILE_OFFSET_DEPRECATION && __LONG_MAX__ < __LONG_LONG_MAX__
+typedef __off_t off_t __attribute_deprecated__;
+#  else
 typedef __off_t off_t;
+#  endif
 # else
 typedef __off64_t off_t;
 # endif

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux