How is this code being ran? When i try to test this code i get the following errors:   make -C /lib/modules/5.11.0-1027-raspi/build M=/home/admin/csc440/project1/jiffies modules make[1]: Entering directory '/usr/src/linux-headers-5.11.0-1027-raspi'   CC [M]  /home/admin/csc440/project1/jiffies/jiffies.o /home/admin/csc440/project1/jiffies/jiffies.c: In function ‘myInit’: /home/admin/csc440/project1/jiffies/jiffies.c:91:46: error: passing argument 4 of ‘proc_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]    91 | my_proc = proc_create("jiffies", 0666, NULL, &fops);       |                                              ^~~~~       |                                              |       |                                              struct file_operations * In file included from /home/admin/csc440/project1/jiffies/jiffies.c:15: ./include/linux/proc_fs.h:109:122: note: expected ‘const struct proc_ops *’ but argument is of type ‘struct file_operations *’   109 | struct proc_dir_entry *proc_create(const char *name, umode_t mode, struct proc_dir_entry *parent, const struct proc_ops *proc_ops);       |                                                                                                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ cc1: some warnings being treated as errors make[2]: *** [scripts/Makefile.build:288: /home/admin/csc440/project1/jiffies/jiffies.o] Error 1 make[1]: *** [Makefile:1852: /home/admin/csc440/project1/jiffies] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-1027-raspi' make: *** [Makefile:4: all] Error 2

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Topic Video
Question

How is this code being ran? When i try to test this code i get the following errors:

 

make -C /lib/modules/5.11.0-1027-raspi/build M=/home/admin/csc440/project1/jiffies modules

make[1]: Entering directory '/usr/src/linux-headers-5.11.0-1027-raspi'

  CC [M]  /home/admin/csc440/project1/jiffies/jiffies.o

/home/admin/csc440/project1/jiffies/jiffies.c: In function ‘myInit’:

/home/admin/csc440/project1/jiffies/jiffies.c:91:46: error: passing argument 4 of ‘proc_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]

   91 | my_proc = proc_create("jiffies", 0666, NULL, &fops);

      |                                              ^~~~~

      |                                              |

      |                                              struct file_operations *

In file included from /home/admin/csc440/project1/jiffies/jiffies.c:15:

./include/linux/proc_fs.h:109:122: note: expected ‘const struct proc_ops *’ but argument is of type ‘struct file_operations *’

  109 | struct proc_dir_entry *proc_create(const char *name, umode_t mode, struct proc_dir_entry *parent, const struct proc_ops *proc_ops);

      |                                                                                                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

cc1: some warnings being treated as errors

make[2]: *** [scripts/Makefile.build:288: /home/admin/csc440/project1/jiffies/jiffies.o] Error 1

make[1]: *** [Makefile:1852: /home/admin/csc440/project1/jiffies] Error 2

make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-1027-raspi'

make: *** [Makefile:4: all] Error 2

 

~~--- 

What version of linux and kernal should i be using? currently i am using Ubuntu 21.04 and Kernal version: 5.11.0-1027-raspi.

Expert Solution
Step 1

According to errors:

/home/admin/csc440/project1/jiffies/jiffies.c:91:46: error: passing argument 4 of ‘proc_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]

 

./include/linux/proc_fs.h:109:122: note: expected ‘const struct proc_ops *’ but argument is of type ‘struct file_operations *’

 

There is no issue in running the script but the code you have written has some compilation error, and the reason is it expects const struct proc_ops *  but it was given a truct file_operations * which is not valid.

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education