<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3020" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=318391017-02022007>I have run into this 
old bug.&nbsp; I'm using an old version of busybox (1.1.3) on an i.MX21 embedded 
system (it's ARM based). &nbsp;I understand what's going on and how it could be 
fixed but I'm not sure if it's a busybox bug or a problem with the 
toolchain.&nbsp; Looking at the code, the problem is still in the latest 
source.&nbsp; Let me explain:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=318391017-02022007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=318391017-02022007>In my case, I'm 
using a "BSP" provided by Freescale for this chip.&nbsp; They provide a 
pre-built toolchain (binutils, gcc, glibc).&nbsp; When the toolchain was built, 
kernel headers from a 2.6.11 kernel were used by glibc.&nbsp; The kernel that is 
running on the board is a heavily patched 2.4.20 kernel.&nbsp; Therefore, when 
libbb/loop.c is compiled it sees a 2.6 kernel, and so uses LOOP_GET_STATUS64 for 
BB_LOOP_GET_STATUS - note that this is ioctl 0x4c05 (if you look in the strace 
output in the log of bug 609 you see this ioctl there, so it looks like the 
original submitter had a similar problem).&nbsp; However, the loop driver in 2.4 
kernels does not support the 64 bit variants of these ioctl's, only the 32 bit 
LOOP_GET_STATUS (which is 0x4c03).&nbsp; When I hack loop.c to use the 2.4 
version of the code, it works on my system properly, so clearly the 2.4 kernel 
supports the loop device fine.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=318391017-02022007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=318391017-02022007>Busybox could be 
modified to work in this scenario by trying the 32 bit version of the ioctl if 
the 64 bit version fails, but I don't know if that goes against the low-bloat 
philosophy of busybox.&nbsp; Does the busybox dev team feel that this is a 
problem with the build system, or should a busybox built with headers from a 2.6 
kernel work with a 2.4 kernel?&nbsp; The vendor I am working from has argued 
that userland applications should not depend on kernel headers and&nbsp;that 
this toolchain has been working for several years with this processor and 
kernel.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=318391017-02022007>&nbsp;&nbsp;&nbsp; 
-Matt</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV align=left><FONT face=Arial size=2>--</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Matt Cross</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Senior Lead Software 
Engineer</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>iRobot Corporation</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>63 South Avenue, Burlington, MA 
01803</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>781-418-3373 (ph)</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>781-345-0201 (fax)</FONT></DIV>
<DIV align=left><FONT face=Arial size=2><A 
href="mailto:mcross@irobot.com">mcross@irobot.com</A></FONT></DIV>
<DIV align=left><FONT face=Arial size=2><A 
href="http://www.irobot.com/">www.irobot.com</A></FONT></DIV>
<DIV align=left>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV></BODY></HTML>