X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fatalk%2Fcompat.h;h=ac7ed55808d9528b163551c20794810faf6e82aa;hb=e638fde6717b993ea123ef693c865ae0935a8cc5;hp=7bd9983d62fb85380bb07e1ca075223a93a83f0a;hpb=ecfc96169ab669b578e53fa8e13592934fe37788;p=netatalk.git diff --git a/include/atalk/compat.h b/include/atalk/compat.h index 7bd9983d..ac7ed558 100644 --- a/include/atalk/compat.h +++ b/include/atalk/compat.h @@ -6,89 +6,57 @@ * are checks for EINTR everywhere. */ -#include +#ifdef HAVE_CONFIG_H +#include "config.h" + #include -#ifdef __svr4__ -/* - * SunOS 5 (solaris) has SA_RESTART, but no SA_INTERRUPT. - */ -#ifndef SA_INTERRUPT -#define SA_INTERRUPT 0 +#if defined(ultrix) || defined(_IBMR2) || defined(NEED_GETUSERSHELL) +extern char *getusershell (void); #endif -#include -#include -#include - -extern int flock __P((int, int)); -extern int inet_aton __P((const char *, struct in_addr *)); -#else /* __svr4__ */ +#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) +# include +# include +# ifndef HAVE_SNPRINTF +int snprintf (char *str,size_t count,const char *fmt,...); +# endif -#ifdef sun -/* - * SunOS 4 has SA_INTERRUPT, but no SA_RESTART. - */ -#ifndef SA_RESTART -#define SA_RESTART 0 +# ifndef HAVE_VSNPRINTF +int vsnprintf(char *str, size_t count, const char *fmt, va_list args); +# endif #endif -#endif /* sun */ - -#endif /* __svr4__ */ - -#ifdef linux -/* - * Linux has SA_RESTART, but no SA_INTERRUPT. Note that the documentation - * seems to be wrong on several counts. First, SA_ONESHOT is not the default, - * and second, SA_RESTART does what you'd expect (the same as svr4) and has - * nothing to do with SA_ONESHOT. - */ -#ifndef SA_INTERRUPT -#define SA_INTERRUPT 0 -#endif /* SA_INTERRUPT */ -#endif /* linux */ - -#ifdef ultrix -#include -#include -#include -/* - * Here's the really confusing one... Under Ultrix, sigaction() works just - * like sigvec(), except that SV_INTERRUPT is always set. Hence, there is - * no SA_INTERRUPT flag. Unfortunately, there's also no SA_RESTART, so - * there's no way to suppress the interrupt. Sigh. - */ -#ifndef SA_INTERRUPT -#define SA_INTERRUPT 0 -#endif -#ifndef SA_RESTART -#define SA_RESTART 0 +/* OpenBSD */ +#if defined(__OpenBSD__) && !defined(ENOTSUP) +#define ENOTSUP EOPNOTSUPP #endif -extern char *strdup __P((const char *)); -extern int inet_aton __P((const char *, struct in_addr *)); -#endif /* ultrix */ +#if !defined(HAVE_PSELECT) || defined(__OpenBSD__) +extern int pselect(int, fd_set * restrict, fd_set * restrict, + fd_set * restrict, const struct timespec * restrict, + const sigset_t * restrict); +#endif -#ifdef BSD4_4 -#ifndef SA_INTERRUPT -#define SA_INTERRUPT 0 +#ifndef HAVE_FLOCK +extern int flock (int, int); #endif -#endif /* BSD4_4 */ -#if defined(ultrix) || defined(_IBMR2) || defined(NEED_GETUSERSHELL) -extern char *getusershell __P((void)); +#ifndef HAVE_INET_ATON +struct in_addr; +extern int inet_aton(const char *, struct in_addr *); #endif -#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) -#include -#include +#ifndef HAVE_STRNLEN +extern size_t strnlen(const char *s, size_t n); #endif -#ifndef HAVE_SNPRINTF -int snprintf (char *str,size_t count,const char *fmt,...); +#ifndef HAVE_STRLCPY +extern size_t strlcpy (char *, const char *, size_t); +#endif + +#ifndef HAVE_STRLCAT +extern size_t strlcat (char *, const char *, size_t); #endif -#ifndef HAVE_VSNPRINTF -int vsnprintf(char *str, size_t count, const char *fmt, va_list args); #endif