This is the actual architecture-independent part of the system call
implementation.
+
+long sys_indirect(struct indirect_registers __user *userregs,
+ void __user *userparams, size_t paramslen)
+{
+ struct indirect_registers regs;
+ long result;
+
+ if (copy_from_user(®s, userregs, sizeof(regs)))
+ return -EFAULT;
+
+ switch (INDIRECT_SYSCALL (®s))
+ {
+#ifdef __NR_accept
+ case __NR_accept:
+#endif
+#ifdef __NR_socketpair
+ case __NR_socketpair:
+#endif
+#ifdef __NR_socket
+ case __NR_socket:
+#endif
+#ifdef __NR_socketcall
+ case __NR_socketcall:
+#endif
+ break;
+
+ default:
+ return -EINVAL;
+ }
+
+ if (paramslen > sizeof(union indirect_params))
+ return -EINVAL;
+ if (copy_from_user(¤t->indirect_params, userparams, paramslen))
+ return -EFAULT;}
+
+ result = CALL_INDIRECT(®s);
+
+ memset(¤t->indirect_params, '\0', paramslen);
+
+ return result;
+}
-