1 /* $NetBSD: uipc_syscalls_30.c,v 1.4 2019/01/27 02:08:39 pgoyette Exp $ */ 2 3 /* written by Pavel Cahyna, 2006. Public domain. */ 4 5 #include <sys/cdefs.h> 6 __KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_30.c,v 1.4 2019/01/27 02:08:39 pgoyette Exp $"); 7 8 #if defined(_KERNEL_OPT) 9 #include "opt_compat_netbsd.h" 10 #endif 11 12 /* 13 * System call interface to the socket abstraction. 14 */ 15 16 #include <sys/param.h> 17 #include <sys/kernel.h> 18 #include <sys/msg.h> 19 #include <sys/sysctl.h> 20 #include <sys/mount.h> 21 #include <sys/syscall.h> 22 #include <sys/syscallvar.h> 23 #include <sys/syscallargs.h> 24 #include <sys/errno.h> 25 26 #include <compat/common/compat_mod.h> 27 28 static const struct syscall_package uipc_syscalls_30_syscalls[] = { 29 { SYS_compat_30_socket, 0, (sy_call_t *)compat_30_sys_socket }, 30 { 0, 0, NULL} 31 }; 32 33 int 34 compat_30_sys_socket(struct lwp *l, 35 const struct compat_30_sys_socket_args *uap, register_t *retval) 36 { 37 int error; 38 39 error = sys___socket30(l, (const void *)uap, retval); 40 if (error == EAFNOSUPPORT) 41 error = EPROTONOSUPPORT; 42 43 return (error); 44 } 45 46 int 47 uipc_syscalls_30_init(void) 48 { 49 50 return syscall_establish(NULL, uipc_syscalls_30_syscalls); 51 } 52 53 int 54 uipc_syscalls_30_fini(void) 55 { 56 57 return syscall_disestablish(NULL, uipc_syscalls_30_syscalls); 58 } 59