Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

221
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda