]>
git.ipfire.org Git - thirdparty/squid.git/blob - compat/os/solaris.h
1 #ifndef SQUID_OS_SOLARIS_H
2 #define SQUID_OS_SOLARIS_H
8 * ugly hack. System headers require wcsstr, but don't define it.
17 * On Solaris 9 x86, gcc may includes a "fixed" set of old system
18 * include files that is incompatible with the updated Solaris
21 #if defined(i386) || defined(__i386)
37 * prototypes for system function missing from system includes
38 * NP: sys/resource.h and sys/time.h are apparently order-dependant.
41 #include <sys/resource.h>
42 SQUIDCEXTERN
int getrusage(int, struct rusage
*);
45 * prototypes for system function missing from system includes
46 * on some Solaris systems.
48 SQUIDCEXTERN
int getpagesize(void);
49 #if !defined(_XPG4_2) && !(defined(__EXTENSIONS__) || \
50 (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)))
51 SQUIDCEXTERN
int gethostname(char *, int);
55 * SunPro CC handles extern inline as inline, PLUS extern symbols.
57 #if !defined(_SQUID_EXTERNNEW_) && defined(__SUNPRO_CC)
58 #define _SQUID_EXTERNNEW_ extern
62 * SunStudio CC does not define C++ portability API __FUNCTION__
64 #if defined(__SUNPRO_CC) && !defined(__FUNCTION__)
65 #define __FUNCTION__ ""
68 /* Exclude CPPUnit tests from the allocator restrictions. */
69 /* BSD implementation uses these still */
70 #if defined(SQUID_UNIT_TEST)
71 #define SQUID_NO_STRING_BUFFER_PROTECT 1
74 /* Bug 2500: Solaris 10/11 require s6_addr* defines. */
75 //#define s6_addr8 _S6_un._S6_u8
76 //#define s6_addr16 _S6_un._S6_u16
77 #define s6_addr32 _S6_un._S6_u32
79 /* Bug 3057: Solaris 9 defines struct addrinfo with size_t instead of socklen_t
80 * this causes binary incompatibility on 64-bit systems.
81 * Fix this by bundling a copy of the OpenSolaris 10 netdb.h to use instead.
83 #if defined(__sparcv9)
84 #include "compat/os/opensolaris_10_netdb.h"
87 /* Solaris 10 lacks SUN_LEN */
89 #define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
92 /* Soaris 10 does not define POSIX AF_LOCAL, but does define the Unix name */
93 #if !defined(AF_LOCAL)
94 #define AF_LOCAL AF_UNIX
97 /* Solaris lacks paths.h by default */
101 #if !defined(_PATH_DEVNULL)
102 #define _PATH_DEVNULL "/dev/null"
105 /* Solaris 10 does not define strsep() */
106 #include "compat/strsep.h"
108 #endif /* _SQUID_SOLARIS_ */
109 #endif /* SQUID_OS_SOALRIS_H */