In linux all socket related system calls are gated throw one system call named socketcall.Its handler is found in /net/socket.c. As one can expect there are a copy_from_user for the arguments and then a switch for all socket functions.
I expected to see in each case a call for a ordinary function , but it seems that there are callings to another system calls. For example the case for 'socket' :
case SYS_SOCKET:
err = sys_socket(a0, a1, a[2]);
break;
sys_socket is also defined in /net/socket.c as :
SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol)
My question is why its defined like this. I guess its for backward compatibility, or I have a mistake somewhere?