[PATCH] fcntl.h: add hack to kill fcntl64 on x86_64

roman at khimov.ru roman at khimov.ru
Sun Apr 25 13:35:09 UTC 2010


From: Roman I Khimov <khimov at altell.ru>

In previous uclibc versions we've had fcntl64 (nonexisting on x86_64) as
an alias to fcntl. Recent NPTL changes removed that alias, although fcntl64
is still present in headers when using _GNU_SOURCE or _FILE_OFFSET_BITS=64.

It confuses applications and leads to linkage failures.

The patch proposed tries to deal with it in headers (thus not reintroducing
fcntl64 alias), although there might be some better way.
---
 include/fcntl.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/fcntl.h b/include/fcntl.h
index e37073f..4bdf7a9 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -73,7 +73,7 @@ __BEGIN_DECLS
 
    This function is a cancellation point and therefore not marked with
    __THROW.  */
-#ifndef __USE_FILE_OFFSET64
+#if !defined (__USE_FILE_OFFSET64) || defined (__x86_64__)
 extern int fcntl (int __fd, int __cmd, ...);
 libc_hidden_proto(fcntl)
 #else
@@ -83,7 +83,7 @@ extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64);
 #  define fcntl fcntl64
 # endif
 #endif
-#ifdef __USE_LARGEFILE64
+#if defined __USE_LARGEFILE64 && !defined (__x86_64__)
 extern int fcntl64 (int __fd, int __cmd, ...);
 libc_hidden_proto(fcntl64)
 #endif
-- 
1.6.4.2



More information about the uClibc mailing list