Advertisement

01.18.2005 at 02:01AM PST, ID: 21278303
[x]
Attachment Details

file operation structure error during compilation

Asked by chikucoder in Linux Programming

Tags: declared, file_operations, initializer

Hi,

Im jst writing kernel module with fileoperatio structure

struct filoperation fops = {
open: open_file();
read:reead_file();
}


Im getting for this structure with compiler version gcc 3.2.2 and gcc 2.95.3

/usr/include/linux/string.h:8: warning: #warning Using kernel
                 header in userland!
                 nulldriver.c:10: warning: `struct file' declared inside
                 parameter list
                 nulldriver.c:10: warning: its scope is only this definition or
                 declaration, which is probably not what you want.
                 nulldriver.c:10: warning: `struct inode' declared inside
                 parameter list
                 nulldriver.c:11: warning: `struct file' declared inside
                 parameter list
                 nulldriver.c:11: warning: `struct inode' declared inside
                 parameter list
                 nulldriver.c:12: parse error before `size_t'
                 nulldriver.c:12: warning: `struct file' declared inside
                 parameter list
                 nulldriver.c:15: variable `stOps' has initializer but
                 incomplete type
                 nulldriver.c:16: unknown field `open' specified in initializer
                 nulldriver.c:16: warning: excess elements in struct
                 initializer
                 nulldriver.c:16: warning: (near initialization for `stOps')
                 nulldriver.c:17: unknown field `read' specified in initializer
                 nulldriver.c:17: warning: excess elements in struct
                 initializer
                 nulldriver.c:17: warning: (near initialization for `stOps')
                 nulldriver.c:18: unknown field `release' specified in
                 initializer
                 nulldriver.c:18: warning: excess elements in struct
                 initializer
                 nulldriver.c:18: warning: (near initialization for `stOps')
                 nulldriver.c:21: parse error before `size_t'
                 nulldriver.c:22: warning: `struct file' declared inside
                 parameter list



Thanks
Start Free Trial
 
Loading Advertisement...
 
[+][-]01.18.2005 at 02:41AM PST, ID: 13070758

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.18.2005 at 10:38AM PST, ID: 13075208

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Linux Programming
Tags: declared, file_operations, initializer
Sign Up Now!
Solution Provided By: roee_f
Participating Experts: 1
Solution Grade: A
 
 
[+][-]01.24.2005 at 01:07AM PST, ID: 13119446

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.04.2005 at 10:59AM PST, ID: 13461459

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]03.08.2005 at 02:01AM PST, ID: 13484664

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32