public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* compile error when using MEMREADOOB in do_mounts.c.
@ 2003-01-03  7:56 Paul Wong
  2003-01-03  8:52 ` Thomas Gleixner
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Wong @ 2003-01-03  7:56 UTC (permalink / raw)
  To: linux-mtd

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];
}

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-01-05 15:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-03  7:56 compile error when using MEMREADOOB in do_mounts.c Paul Wong
2003-01-03  8:52 ` Thomas Gleixner
2003-01-03  9:22   ` Paul Wong
2003-01-04 20:32     ` Thomas Gleixner
2003-01-05  8:49       ` Paul Wong
2003-01-05  9:37         ` Thomas Gleixner
2003-01-05 15:56           ` Paul Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox