Loading ...
Sorry, an error occurred while loading the content.

Proc fs problem

Expand Messages
  • shyam
    Hi all, I am a beginner to kernel programming. I was trying the code in the is document http://www.linuxhq.com/guides/LKMPG/node16.html The code given for the
    Message 1 of 1 , Jun 8, 2004
    • 0 Attachment
      Hi all,

      I am a beginner to kernel programming. I was trying the code in the is
      document



      http://www.linuxhq.com/guides/LKMPG/node16.html



      The code given for the procfs does not compile and throws error messages.
      Here is what I have tried. I tried to compile the code

      On Mandrake 7.0 (default kernel and sources ), redhat 9.0 ( default ).
      However both seem to give the same errors. I am posting a portion of the
      errors I got.

      Thanks in advance for solution.



      My /include/linux is a symbolic link to /usr/src/linux/include/linux.



      In file included from procfs.c:6:

      /usr/include/linux/module.h:60: parse error before `atomic_t'

      /usr/include/linux/module.h:60: warning: no semicolon at end of struct or
      union

      /usr/include/linux/module.h:60: warning: no semicolon at end of struct or
      union

      /usr/include/linux/module.h:62: parse error before `}'

      /usr/include/linux/module.h:62: warning: data definition has no type or
      storage class

      /usr/include/linux/module.h:91: parse error before `}'

      In file included from procfs.c:15:

      /usr/include/linux/proc_fs.h:47: parse error before `off_t'

      /usr/include/linux/proc_fs.h:50: warning: `struct file' declared inside
      parameter list

      /usr/include/linux/proc_fs.h:50: warning: its scope is only this definition
      or declaration, which is probably not what you want.

      /usr/include/linux/proc_fs.h:51: parse error before `off_t'

      /usr/include/linux/proc_fs.h:57: parse error before `mode_t'



      .

      .

      .

      .

      .

      procfs.c:27: parse error before `off_t'

      procfs.c: In function `procfile_read':

      procfs.c:39: `offset' undeclared (first use in this function)

      procfs.c:51: `buffer_location' undeclared (first use in this function)

      procfs.c: At top level:

      procfs.c:58: variable `Our_Proc_File' has initializer but incomplete type

      procfs.c:60: warning: excess elements in struct initializer

      procfs.c:60: warning: (near initialization for `Our_Proc_File')

      procfs.c:62: warning: excess elements in struct initializer

      procfs.c:62: warning: (near initialization for `Our_Proc_File')

      procfs.c:63: warning: excess elements in struct initializer

      procfs.c:63: warning: (near initialization for `Our_Proc_File')

      procfs.c:64: `S_IFREG' undeclared here (not in a function)

      procfs.c:64: `S_IRUGO' undeclared here (not in a function)

      procfs.c:64: warning: excess elements in struct initializer

      procfs.c:64: warning: (near initialization for `Our_Proc_File')

      procfs.c:68: warning: excess elements in struct initializer

      procfs.c:68: warning: (near initialization for `Our_Proc_File')

      procfs.c:70: warning: excess elements in struct initializer

      procfs.c:70: warning: (near initialization for `Our_Proc_File')

      procfs.c:70: warning: excess elements in struct initializer

      procfs.c:70: warning: (near initialization for `Our_Proc_File')

      procfs.c:72: warning: excess elements in struct initializer

      procfs.c:72: warning: (near initialization for `Our_Proc_File')

      procfs.c:73: warning: excess elements in struct initializer

      procfs.c:73: warning: (near initialization for `Our_Proc_File')

      procfs.c:76: warning: excess elements in struct initializer

      procfs.c:76: warning: (near initialization for `Our_Proc_File')

      procfs.c:82: warning: excess elements in struct initializer

      procfs.c:82: warning: (near initialization for `Our_Proc_File')

      procfs.c: In function `cleanup_module':

      procfs.c:104: invalid use of undefined type `struct proc_dir_entry'

      make: *** [procfs.o] Error 1











      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.