All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul Wong" <paul.wong@digitalview.com>
To: <linux-mtd@lists.infradead.org>
Subject: compile error when using MEMREADOOB in do_mounts.c.
Date: Fri, 3 Jan 2003 15:56:29 +0800	[thread overview]
Message-ID: <000201c2b2fd$dc75c190$9000010a@paulwong> (raw)

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

             reply	other threads:[~2003-01-03  7:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-03  7:56 Paul Wong [this message]
2003-01-03  8:52 ` compile error when using MEMREADOOB in do_mounts.c 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000201c2b2fd$dc75c190$9000010a@paulwong' \
    --to=paul.wong@digitalview.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.