]> arthur.barton.de Git - netatalk.git/blobdiff - include/atalk/compat.h
Remove inet_aton from compatibility library
[netatalk.git] / include / atalk / compat.h
index 429955349f74c9ca2572357c68851f5f359c1167..a2d318f43a4f81942210a3a922941224f01e043b 100644 (file)
@@ -6,91 +6,25 @@
  * are checks for EINTR everywhere. 
  */
 
-#include <sys/cdefs.h>
-#include <signal.h>
-
-#ifdef __svr4__
-/*
- * SunOS 5 (solaris) has SA_RESTART, but no SA_INTERRUPT.
- */
-#ifndef SA_INTERRUPT
-#define SA_INTERRUPT   0
-#endif
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-extern int flock (int, int);
-extern int inet_aton (const char *, struct in_addr *);
-#else /* __svr4__ */
-
-#ifdef sun
-/*
- * SunOS 4 has SA_INTERRUPT, but no SA_RESTART.
- */
-#ifndef SA_RESTART
-#define SA_RESTART     0
-#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 <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * 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
-#endif
+#ifdef HAVE_CONFIG_H
+#include "config.h"
 
-extern char *strdup (const char *);
-extern int inet_aton (const char *, struct in_addr *);
-#endif /* ultrix */
-
-#ifdef BSD4_4
-#ifndef SA_INTERRUPT
-#define SA_INTERRUPT   0
-#endif
-#endif /* BSD4_4 */
+#include <signal.h>
 
 #if defined(ultrix) || defined(_IBMR2) || defined(NEED_GETUSERSHELL)
 extern char *getusershell (void);
 #endif
 
 #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
-#include <stdio.h>
-#include <stdarg.h>
-#endif
-
-#ifndef HAVE_SNPRINTF
+# include <stdio.h>
+# include <stdarg.h>
+# ifndef HAVE_SNPRINTF
 int snprintf (char *str,size_t count,const char *fmt,...);
-#endif
+# endif
 
-#ifndef HAVE_VSNPRINTF
+# ifndef HAVE_VSNPRINTF
 int vsnprintf(char *str, size_t count, const char *fmt, va_list args);
+# endif
 #endif
 
 /* OpenBSD */
@@ -103,3 +37,21 @@ extern int pselect(int, fd_set * restrict, fd_set * restrict,
                    fd_set * restrict, const struct timespec * restrict,
                    const sigset_t * restrict);
 #endif
+
+#ifndef HAVE_FLOCK
+extern int flock (int, int);
+#endif
+
+#ifndef HAVE_STRNLEN
+extern size_t strnlen(const char *s, size_t n);
+#endif
+
+#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
+
+#endif