I am trying to hook the socket system call on linux x86_32. This system call does not exist but is gated through socketcall.
man socketcall: socketcall() is a common kernel entry point for the socket system calls. call determines which socket function to invoke. args points to a block containing the actual arguments, which are passed through to the appropriate call.
I hooked this syscall (__NR_socketcall is 102 on my system which is also stated on http://docs.cs.up.ac.za/programming/asm/derick_tut/syscalls.html) with my own function which prints something and calls the original function afterwards. However, my function is never called. Furthermore, strace shows that a socket() syscall is called.
The basic question: How can I hook socket syscalls on linux x86_32?
Subquestion: Why does strace show the socket() syscall and not socketcall()?
Everything works as expected on x86_64 where a socket syscall exists.