Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
sysctl doesn't creates file in proc

To communicate in kernel mode and user space, I am using this C program. I am using following Makefile to create .ko file to load.

bj-m   := sysctl_test.o

KDIR    := /lib/modules/$(shell uname -r)/build
PWD    := $(shell pwd)

default:
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

clean:
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean

After successful execution, and loading the .ko file, it should have create /proc/sys/net/test directory, and value1 and value2 file in that directory.

When I load this module, it doesn't create any file or directory. Am I doing something wrong here or code need some changes?

I have tried by modifying values in structures as:

static ctl_table test_net_table[] = {
        {
                ... 
                .procname       = "/proc/sys/net/test",
                ...
        },
        { .ctl_name = 0 }
};

static ctl_table test_root_table[] = {
        {
                ...
                .procname       = "/proc/sys/net/",
                ...
        },
        { .ctl_name = 0 }
};

The original values was test and net respectively.

Thanks for your time!

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Try changing

bj-m   := sysctl_test.o

to

obj-m   := sysctl_test.o

it worked for me.

PS:Its an old question, but I update answer for those who come across same error and stop her.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!