mirror of
https://github.com/nmap/nmap.git
synced 2026-10-20 19:01:56 +00:00
Define CMSG_ALIGN, CMSG_SPACE, and CMSG_LEN for old Solaris.
This was reported by Dagobert Michelsen and comes from http://wiki.opencsw.org/porting-faq#toc10.
This commit is contained in:
parent
d18c149e8c
commit
1ef0db4b33
1 changed files with 20 additions and 0 deletions
|
|
@ -111,6 +111,26 @@
|
|||
#endif
|
||||
#include <net/if_arp.h>
|
||||
|
||||
/* Define CMSG_* symbols for Solaris 9 and earlier. See
|
||||
http://wiki.opencsw.org/porting-faq#toc10. */
|
||||
#if defined(__sun) || defined(__sun__)
|
||||
# ifndef CMSG_ALIGN
|
||||
# ifdef __sun__
|
||||
# define CMSG_ALIGN(len) _CMSG_DATA_ALIGN (len)
|
||||
# else
|
||||
/* aligning to sizeof (long) is assumed to be portable (fd.o#40235) */
|
||||
# define CMSG_ALIGN(len) (((len) + sizeof (long) - 1) & ~(sizeof (long) - 1))
|
||||
# endif
|
||||
# endif
|
||||
# ifndef CMSG_SPACE
|
||||
# define CMSG_SPACE(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + CMSG_ALIGN (len))
|
||||
# endif
|
||||
# ifndef CMSG_LEN
|
||||
# define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
|
||||
# endif
|
||||
#endif /* Solaris */
|
||||
|
||||
|
||||
#if HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue