lib/libc/compat/sys/compat_socket.c

http://www.minix3.org/ · C · 27 lines · 20 code · 6 blank · 1 comment · 3 complexity · 54d8291bf8b9519fe3047fbb0305b6e3 MD5 · raw file

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