Re: Problem in calling System call [sys_mknod] in Kernel Module.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I need to call sys_mknod from a module and I did the
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <linux/unistd.h>
> #include <linux/ctype.h>
> #include <linux/fs.h>
		
	Hi there !,
	Try including linux/syscalls.h

> extern asmlinkage long sys_mknod(const char *name, int
> mode, dev_t dev);
> ./Chardev.o: unresolved symbol sys_mknod

	Insted of this, declare a function pointer to point to sys_mknod
function, get the address of sys_mknod from sys_call_table[__NR_mknod]
and then use that function pointer to call sys_mknod. What is happening
in your case is the kernel is not getting the definition of the sys_mknod
in your modules object file that's why throws an error above...
-- 
regards
   -Prasad
PS: All corrections are most welcome...!


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux