From mboxrd@z Thu Jan 1 00:00:00 1970 From: mulyadi.santosa@gmail.com (Mulyadi Santosa) Date: Wed, 23 Feb 2011 00:50:22 +0700 Subject: adding a system call In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Tue, Feb 22, 2011 at 22:18, mohit verma wrote: > hi all , >> >> i followed the link and tried to add a system call in kernel-version >> 2.6.37 >> here is the code : >> >> >> #include >> #include >> #include? //for getname >> #include //for PTR_ERR >> asmlinkage int sys_hariohm(const char __user *filename) >> { >> ??? char *tmp = getname(filename); >> ???? int fd=PTR_ERR(tmp); >> ??????? if (!IS_ERR(tmp)) >> ??????? { >> ??????? printk("filename %s \n",tmp); >> ??????? putname(tmp); >> ??????? return fd; >> ??????? } >> ??????? else >> ??????? { >> ??????? return 2; >> ??????? } >> } which syscall number did you assigned to this syscall? and exactly how do you assign it? NB: your code style doesn't follow the Linux kernel coding standart.... -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com