]>
git.ipfire.org Git - thirdparty/squid.git/blob - compat/os/solaris.h
2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_OS_SOLARIS_H
10 #define SQUID_OS_SOLARIS_H
15 * ugly hack. System headers require wcsstr, but don't define it.
24 * On Solaris 9 x86, gcc may includes a "fixed" set of old system
25 * include files that is incompatible with the updated Solaris
28 #if defined(i386) || defined(__i386)
44 * prototypes for system function missing from system includes
45 * NP: sys/resource.h and sys/time.h are apparently order-dependant.
48 #include <sys/resource.h>
49 SQUIDCEXTERN
int getrusage(int, struct rusage
*);
52 * prototypes for system function missing from system includes
53 * on some Solaris systems.
55 SQUIDCEXTERN
int getpagesize(void);
56 #if !defined(_XPG4_2) && !(defined(__EXTENSIONS__) || \
57 (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)))
58 SQUIDCEXTERN
int gethostname(char *, int);
62 * SunPro CC handles extern inline as inline, PLUS extern symbols.
64 #if !defined(_SQUID_EXTERNNEW_) && defined(__SUNPRO_CC)
65 #define _SQUID_EXTERNNEW_ extern
69 * SunStudio CC does not define C++ portability API __FUNCTION__
71 #if defined(__SUNPRO_CC) && !defined(__FUNCTION__)
72 #define __FUNCTION__ ""
75 /* Bug 2500: Solaris 10/11 require s6_addr* defines. */
76 //#define s6_addr8 _S6_un._S6_u8
77 //#define s6_addr16 _S6_un._S6_u16
78 #define s6_addr32 _S6_un._S6_u32
80 /* Bug 3057: Solaris 9 defines struct addrinfo with size_t instead of socklen_t
81 * this causes binary incompatibility on 64-bit systems.
82 * Fix this by bundling a copy of the OpenSolaris 10 netdb.h to use instead.
84 #if defined(__sparcv9)
85 #include "compat/os/opensolaris_10_netdb.h"
88 /* Solaris 10 lacks SUN_LEN */
90 #define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
93 /* Soaris 10 does not define POSIX AF_LOCAL, but does define the Unix name */
94 #if !defined(AF_LOCAL)
95 #define AF_LOCAL AF_UNIX
98 /* Solaris lacks paths.h by default */
102 #if !defined(_PATH_DEVNULL)
103 #define _PATH_DEVNULL "/dev/null"
106 #endif /* _SQUID_SOLARIS_ */
107 #endif /* SQUID_OS_SOALRIS_H */