cmsg_extras.h 517 B

1234567891011121314151617181920212223
  1. #ifndef VSF_CMSG_EXTRAS_H
  2. #define VSF_CMSG_EXTRAS_H
  3. #include <sys/types.h>
  4. #include <sys/socket.h>
  5. /* These are from Linux glibc-2.2 */
  6. #ifndef CMSG_ALIGN
  7. #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
  8. & ~(sizeof (size_t) - 1))
  9. #endif
  10. #ifndef CMSG_SPACE
  11. #define CMSG_SPACE(len) (CMSG_ALIGN (len) \
  12. + CMSG_ALIGN (sizeof (struct cmsghdr)))
  13. #endif
  14. #ifndef CMSG_LEN
  15. #define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
  16. #endif
  17. #endif /* VSF_CMSG_EXTRAS_H */