undefined refernce to 'errno'
Hi,
when I run a small program after building a new kernel ( after adding my own new system call), I am getting this error.. =============================== /tmp/cceoGVXN.o(.text+0x23):In function 'mysystemcall' :undefined reference to 'errno' collect2?:ld returned 1 exit status ========================================= thanks in advance... rgds, hegdeshashi |
hi,
You need to add errno.h to source file |
Hi,
I included errno.h in source file.It is compiling ..but the output is -1 .. what is the problem? is it kernel compilation problem or something else.. thanks in advance. hegdeshashi |
hi,
i dont think so but it will be great if you tell me what steps you followed and show your user mode code here. |
Hi,
I followed all steps of kernel compilation (for linux-2.4.24) In a new kernel, I am running my sample program to check my new implemented system call . But compilation is going smoothly..output is -1...it means that , function is not implemented? after I am checking using this cmd.. strace ./a.out( executable of user mode code) function not implemented..-1 code is... #include<linux/myroutine.h> // myroutine is my new system call program. main(){ int sum=0; sum=myroutine(10,10); printf("%d",sum); } I am referring this url: http://www.linuxgazette.com/node/9793 thanks in advance... |
Hi,
I assume from that link you have implemented 1)kernel space header for new syscall 2)Actual syscall implementaion 3)User spcae header 4)user space sample prog to test syscall 5)then modify entry.S 6)modify unistd.h in kernel source as well as user space Have you done all these things i thing you have not done user spcae modification to /usr/include/asm-i386/unistd.h |
Hi,
I did all modifications modificaitons both in kernel and usr space.. I am getting strange error like -1 .. |
hi,
I am sure that you must be missing something that is giving you error -1 |
hi,
you can crosscheck your implementation at http://fossil.wpi.edu/docs/howto_add_systemcall.html moreover you can check whether you have got your new syscall function entry in /proc/ksyms |
Hi,
we checked in /proc/ksyms mysystem call is not found.. but it is in system.map |
hi,
show me your last lines from unistd.h file from both kernel header and user header files. |
hi,,
In /usr/src/linux-2.4.24/include/asm-i386/unistd.h #define __NR_exit_group 252 #define __NR_myroutine 268 //my new system call in /usr/include/asm/unistd.h #define __NR_set_tid_address 258 #define __NR_myroutine 268 ================================ |
hi,
it looks ok. i am still not able to determine what can be the problem? but somehow syscall is not getting called from user spcae program. check if you have forgotten to modify Makefile===> Quote:
|
Hi,
I did all the modifications ,but when I run the sample program which I wrote for my own system call , gives -1 . This means system call is not implemeted? I followed this url: http://www.linuxgazette.com/node/9793 |
All times are GMT -5. The time now is 08:53 AM. |