You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

83 lines
1.8 KiB

  1. cdef extern from "arpa/inet.h" nogil:
  2. int ntohl(int)
  3. int htonl(int)
  4. int ntohs(int)
  5. cdef extern from "sys/socket.h" nogil:
  6. struct sockaddr:
  7. unsigned short sa_family
  8. char sa_data[14]
  9. struct addrinfo:
  10. int ai_flags
  11. int ai_family
  12. int ai_socktype
  13. int ai_protocol
  14. size_t ai_addrlen
  15. sockaddr* ai_addr
  16. char* ai_canonname
  17. addrinfo* ai_next
  18. struct sockaddr_in:
  19. unsigned short sin_family
  20. unsigned short sin_port
  21. # ...
  22. struct sockaddr_in6:
  23. unsigned short sin6_family
  24. unsigned short sin6_port
  25. unsigned long sin6_flowinfo
  26. # ...
  27. unsigned long sin6_scope_id
  28. struct sockaddr_storage:
  29. unsigned short ss_family
  30. # ...
  31. const char *gai_strerror(int errcode)
  32. int socketpair(int domain, int type, int protocol, int socket_vector[2])
  33. int setsockopt(int socket, int level, int option_name,
  34. const void *option_value, int option_len)
  35. cdef extern from "sys/un.h" nogil:
  36. struct sockaddr_un:
  37. unsigned short sun_family
  38. char* sun_path
  39. # ...
  40. cdef extern from "unistd.h" nogil:
  41. ssize_t write(int fd, const void *buf, size_t count)
  42. void _exit(int status)
  43. cdef extern from "pthread.h" nogil:
  44. int pthread_atfork(
  45. void (*prepare)() nogil,
  46. void (*parent)() nogil,
  47. void (*child)() nogil)
  48. cdef extern from "includes/compat.h" nogil:
  49. cdef int EWOULDBLOCK
  50. cdef int PLATFORM_IS_APPLE
  51. cdef int PLATFORM_IS_LINUX
  52. struct epoll_event:
  53. # We don't use the fields
  54. pass
  55. int EPOLL_CTL_DEL
  56. int epoll_ctl(int epfd, int op, int fd, epoll_event *event)