linux.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3  *
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.
7  */
8 
9 #ifndef SQUID_COMPAT_OS_LINUX_H
10 #define SQUID_COMPAT_OS_LINUX_H
11 
12 #if _SQUID_LINUX_
13 
14 /****************************************************************************
15  *--------------------------------------------------------------------------*
16  * DO *NOT* MAKE ANY CHANGES below here unless you know what you're doing...*
17  *--------------------------------------------------------------------------*
18  ****************************************************************************/
19 
20 #if USE_ASYNC_IO
21 #define _SQUID_LINUX_THREADS_
22 #endif
23 
24 /*
25  * res_init() is just a macro re-definition of __res_init on Linux (Debian/Ubuntu)
26  */
27 #if !defined(HAVE_RES_INIT) && defined(HAVE___RES_INIT) && !defined(res_init)
28 #define res_init __res_init
29 #define HAVE_RES_INIT HAVE___RES_INIT
30 #endif
31 
32 /*
33  * Netfilter header madness. (see Bug 4323)
34  *
35  * Netfilter have a history of defining their own versions of network protocol
36  * primitives without sufficient protection against the POSIX defines which are
37  * always present in Linux.
38  *
39  * netinet/in.h must be included before any other sys header in order to properly
40  * activate include guards in <linux/libc-compat.h> the kernel maintainers added
41  * to workaround it.
42  */
43 #if HAVE_NETINET_IN_H
44 #include <netinet/in.h>
45 #endif
46 
47 /*
48  * glob.h is provided by GNU on Linux and contains some unavoidable preprocessor
49  * logic errors in its 64-bit definitions which are hit by non-GCC compilers.
50  *
51  * #if __USE_FILE_OFFSET64 && __GNUC__ < 2
52  * # define glob glob64
53  * #endif
54  * #if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2
55  * extern "C" glob(...);
56  * #endif
57  * extern "C" glob64(...);
58  *
59  * ... and multiple "C" definitions of glob64 refuse to compile.
60  * Because __GNUC__ being undefined equates to 0 and (0 < 2)
61  */
62 #if __USE_FILE_OFFSET64 && __GNUC__ < 2
63 #if HAVE_GLOB_H
64 #undef HAVE_GLOB_H
65 #endif
66 #if HAVE_GLOB
67 #undef HAVE_GLOB
68 #endif
69 #endif
70 
71 #endif /* _SQUID_LINUX_ */
72 #endif /* SQUID_COMPAT_OS_LINUX_H */
73 

 

Introduction

Documentation

Support

Miscellaneous