Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

228
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda