socket.h 738 B

123456789101112131415161718192021
  1. #ifndef _LINUX_SOCKET_H
  2. #define _LINUX_SOCKET_H
  3. /*
  4. * Desired design of maximum size and alignment (see RFC2553)
  5. */
  6. #define _K_SS_MAXSIZE 128 /* Implementation specific max size */
  7. #define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *))
  8. /* Implementation specific desired alignment */
  9. typedef unsigned short __kernel_sa_family_t;
  10. struct __kernel_sockaddr_storage {
  11. __kernel_sa_family_t ss_family; /* address family */
  12. /* Following field(s) are implementation specific */
  13. char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
  14. /* space to achieve desired size, */
  15. /* _SS_MAXSIZE value minus size of ss_family */
  16. } __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */
  17. #endif /* _LINUX_SOCKET_H */