From mboxrd@z Thu Jan 1 00:00:00 1970 From: mohit89mlnc@gmail.com (mohit verma) Date: Tue, 22 Feb 2011 20:48:18 +0530 Subject: adding a system call In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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; > } > } > > > the compilation process was silent (without any error). > but when i try to boot into the kernel having this system call , i get the > errors like : > > do_exit() ,do_group_exit() , syscall_init() error lines with some > addresses. > > can someone help me understand what is wrong with this code? > > thanks in advance :) > > and also when i tried to boot into this kernel , it was showing some * initrafs* error. > -- > ........................ > *MOHIT VERMA* > > -- ........................ *MOHIT VERMA* -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110222/59532f0c/attachment.html