1 /* $NetBSD: compat_socket.c,v 1.1 2006/06/26 21:23:56 mrg Exp $ */ 2 3 #include <sys/cdefs.h> 4 #if defined(LIBC_SCCS) && !defined(lint) 5 __RCSID("$NetBSD: compat_socket.c,v 1.1 2006/06/26 21:23:56 mrg Exp $"); 6 #endif /* LIBC_SCCS and not lint */ 7 8 #define __LIBC12_SOURCE__ 9 10 #include <errno.h> 11 #include <sys/types.h> 12 #include <sys/socket.h> 13 #include <compat/sys/socket.h> 14 15 __warn_references(socket, 16 "warning: reference to compatibility socket(); include <sys/socket.h> for correct reference") 17 18 int socket(int domain,int type,int protocol)19socket(int domain, int type, int protocol) 20 { 21 int res; 22 23 res = __socket30(domain, type, protocol); 24 if (errno == EAFNOSUPPORT) 25 errno = EPROTONOSUPPORT; 26 return res; 27 } 28