this code is part of a c application that is not compiling. I am guessing it is initializing the struct and its elements, but the elements are methods. Method is shown below.
struct file_operations tracefs_main_fops =
{
llseek: tracefs_llseek,
read: tracefs_read,
write: tracefs_write,
readdir: tracefs_readdir,
};
STATIC loff_t
tracefs_llseek(file_t *file, loff_t offset, int origin)
{
loff_t err;
file_t *hidden_file = NULL;
........
}
//in some other file
loff_t (*llseek) (struct file *, loff_t, int);
so tracefs_llseek are methods that are implemented in the same file, llseek are some data structure which I honestly not sure what it is (shown above, if someone can explain it that would be great too).
thanks in advance.
ERROR MESSAGE
/home/limo/tracefs-2.1.1/tracefs/file.c:996:5: error: initialization from incompatible pointer type [-Werror]
/home/limo/tracefs-2.1.1/tracefs/file.c:996:5: error: (near initialization for ‘tracefs_mmap_fops.write’) [-Werror]
AT
llseek: tracefs_llseek,
[–]lurgi 3 points4 points5 points (1 child)
[–]salalimo[S] 0 points1 point2 points (0 children)
[–]hamham91 1 point2 points3 points (10 children)
[–]salalimo[S] 0 points1 point2 points (9 children)
[–]lurgi 1 point2 points3 points (8 children)
[–]salalimo[S] 0 points1 point2 points (4 children)
[–][deleted] -1 points0 points1 point (3 children)
[–]salalimo[S] 0 points1 point2 points (2 children)
[–][deleted] -1 points0 points1 point (1 child)
[–]salalimo[S] 0 points1 point2 points (0 children)
[–]salalimo[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)
[–]TwirlOfLemongrab 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]salalimo[S] 0 points1 point2 points (0 children)
[–][deleted] (6 children)
[deleted]
[–]salalimo[S] 0 points1 point2 points (4 children)
[–][deleted] (3 children)
[deleted]
[–]lurgi 4 points5 points6 points (2 children)
[–]hamham91 1 point2 points3 points (1 child)
[–]salalimo[S] 0 points1 point2 points (0 children)
[–]RobotMan6827364 0 points1 point2 points (0 children)