compile error when using MEMREADOOB in do_mounts.c.

Paul Wong paul.wong at digitalview.com
Fri Jan 3 02:56:29 EST 2003


Dear All,

    I modified the init/do_mounts.c to want to skip the invalid block. and
than make bzImage, that result say: undefined reference to 'ioctl'. What is
the problem?

Thank you.
best regards,
Paul

****** part of init/do_mounts.c *********

#include <linux/mtd/mtd.h>

static int __init fill_inbuf(void)
{
 static unsigned long curptr=0L;
 if (exit_code) return -1;

#if 1 // for mtd read and check valid block
{
 #define MTDBLOCKSIZE 16384
 unsigned char oobbuf[16];
 struct mtd_oob_buf oob;

 oob.length = 16;
 oob.ptr = (unsigned char*)&oobbuf;
 for (;(curptr%MTDBLOCKSIZE)==0;
  curptr =lseek(crd_infd,MTDBLOCKSIZE,1))
 {
  oob.start = curptr;
  if (ioctl(crd_infd, MEMREADOOB, &oob) != 0)
  {
    return  -1;
  }
  if (oobbuf[5] == 0xFF)
   break;
  }
}
#endif
 insize = read(crd_infd, inbuf, INBUFSIZ);

 if (insize == 0) return -1;
 curptr += insize;
 inptr = 1;

 return inbuf[0];
}





More information about the linux-mtd mailing list