Re: blkid_llseek fix for uClibc without large file support

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

 



On Monday, November 29, 2010 05:53:36 Graham Gower wrote:
> On 29 November 2010 20:50, Karel Zak wrote:
> > On Mon, Nov 29, 2010 at 12:05:24PM +1030, Graham Gower wrote:
> >> uClibc may be built without large file support (no llseek, lseek64,
> >> etc).
> >> 
> >> The below patch fixes things for me in this case. Patch is against 2.17,
> >> but it doesn't look like the code has changed recently.
> >> 
> >> --- util-linux-ng-2.17/shlibs/blkid/src/llseek.c.orig 2010-11-29
> >> 11:31:49.000000000 +1030 +++
> >> util-linux-ng-2.17/shlibs/blkid/src/llseek.c      2010-11-29
> >> 11:52:07.000000000 +1030 @@ -28,7 +28,7 @@
> >> 
> >>  #include "blkidP.h"
> >> 
> >> -#ifdef __linux__
> >> +#if defined(__linux__) && !(defined(__UCLIBC__) &&
> >> !defined(__USE_FILE_OFFSET64))
> > 
> >  Not sure...
> > 
> >>  #if defined(HAVE_LSEEK64) && defined(HAVE_LSEEK64_PROTOTYPE) ||
> >> defined(__UCLIBC__)
> > 
> >  ... wouldn't be enough to use:
> > 
> >  #if defined(HAVE_LSEEK64) && defined(HAVE_LSEEK64_PROTOTYPE) || \
> >      defined(__UCLIBC__) && defined(__USE_FILE_OFFSET64)
> > 
> >  ?
> > 
> >  The code inside __linux__ conditional block seems useful
> >  independently on libc, it calls llseek syscall directly.
> > 
> >  Unfortunately, I don't have uClib to test it. Mike, any comment?
> 
> No. There is no llseek in the uClibc I have built. Hence falling back
> to lseek was the route I took.

Karel said "syscall", not "library function".  i think his counter suggestion
should work.  although i'm not sure why this file checks __UCLIBC__ at all if
there are proper configure tests for lseek64/llseek ...

testing against a uClibc w/LFS enabled shows that both HAVE_LSEEK64 and
HAVE_LSEEK64_PROTOTYPE are defined as expected.  i dont have a toolchain w/LFS
disabled atm, but i could build up one if necessary.

so my counter-counter-proposal is:

--- a/shlibs/blkid/src/llseek.c
+++ b/shlibs/blkid/src/llseek.c
@@ -30,7 +30,7 @@
 
 #ifdef __linux__
 
-#if defined(HAVE_LSEEK64) && defined(HAVE_LSEEK64_PROTOTYPE) || defined(__UCLIBC__)
+#if defined(HAVE_LSEEK64) && defined(HAVE_LSEEK64_PROTOTYPE)
 
 #define my_llseek lseek64
 
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux