9#ifndef _SQUID_COMPAT_SHARED_H
10#define _SQUID_COMPAT_SHARED_H
39#if HAVE_SYS_RESOURCE_H
40#include <sys/resource.h>
49#if defined(__USE_FILE_OFFSET64) && !defined(__GNUC__)
50#define dirent_t struct dirent64
52#define dirent_t struct dirent
64#if defined(USE_SELECT)
66# define SQUID_MAXFD_LIMIT ((signed int)FD_SETSIZE)
68#elif defined(USE_POLL)
70# define SQUID_MAXFD_LIMIT ((signed int)FD_SETSIZE)
72#elif defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL)
73# define SQUID_FDSET_NOUSE 1
76# error Unknown select loop model!
79#if !HAVE_STRUCT_RUSAGE
111#define min(a,b) ((a) < (b) ? (a) : (b))
132#define max(a,b) ((a) < (b) ? (b) : (a))
139#define w_space " \t\n\r"
141#ifndef SQUID_NONBLOCK
146#if defined(O_NONBLOCK)
153#define SQUID_NONBLOCK O_NONBLOCK
156#define SQUID_NONBLOCK O_NDELAY
164#if defined(__cplusplus)
178#define SA_RESETHAND 0
180#if SA_RESETHAND == 0 && defined(SA_ONESHOT)
182#define SA_RESETHAND SA_ONESHOT
192#include <et/com_err.h>
220#define memcpy(d,s,n) bcopy((s),(d),(n))
222#define memcpy(d,s,n) memmove((d),(s),(n))
226#if !HAVE_MEMMOVE && HAVE_BCOPY
227#define memmove(d,s,n) bcopy((s),(d),(n))
235#define squid_strnstr(a,b,c) strnstr(a,b,c)
238const char *
squid_strnstr(
const char *s,
const char *find,
size_t slen);
243#define PRINTF_FORMAT_ARG1 __attribute__ ((format (gnu_printf, 1, 2)))
244#define PRINTF_FORMAT_ARG2 __attribute__ ((format (gnu_printf, 2, 3)))
245#define PRINTF_FORMAT_ARG3 __attribute__ ((format (gnu_printf, 3, 4)))
247#define PRINTF_FORMAT_ARG1 __attribute__ ((format (printf, 1, 2)))
248#define PRINTF_FORMAT_ARG2 __attribute__ ((format (printf, 2, 3)))
249#define PRINTF_FORMAT_ARG3 __attribute__ ((format (printf, 3, 4)))
252#define PRINTF_FORMAT_ARG1
253#define PRINTF_FORMAT_ARG2
254#define PRINTF_FORMAT_ARG3
void(* failure_notify)(const char *)
A const & max(A const &lhs, A const &rhs)
A const & min(A const &lhs, A const &rhs)
const char * squid_strnstr(const char *s, const char *find, size_t slen)