]> arthur.barton.de Git - netatalk.git/blob - include/atalk/compat.h
Include config.h.
[netatalk.git] / include / atalk / compat.h
1 /*
2  * Copyright (c) 1996 Regents of The University of Michigan.
3  * All Rights Reserved.  See COPYRIGHT.
4  *
5  * NOTE: SunOS 4 and ultrix are pretty much the only reason why there
6  * are checks for EINTR everywhere. 
7  */
8
9 #include <config.h>
10
11 #include <sys/cdefs.h>
12 #include <signal.h>
13
14 #ifdef __svr4__
15 /*
16  * SunOS 5 (solaris) has SA_RESTART, but no SA_INTERRUPT.
17  */
18 #ifndef SA_INTERRUPT
19 #define SA_INTERRUPT    0
20 #endif
21
22 #include <sys/types.h>
23 #include <netinet/in.h>
24 #include <arpa/inet.h>
25
26 extern int flock __P((int, int));
27 extern int inet_aton __P((const char *, struct in_addr *));
28 #else /* __svr4__ */
29
30 #ifdef sun
31 /*
32  * SunOS 4 has SA_INTERRUPT, but no SA_RESTART.
33  */
34 #ifndef SA_RESTART
35 #define SA_RESTART      0
36 #endif
37 #endif /* sun */
38
39 #endif /* __svr4__ */
40
41 #ifdef linux
42 /*
43  * Linux has SA_RESTART, but no SA_INTERRUPT.  Note that the documentation
44  * seems to be wrong on several counts.  First, SA_ONESHOT is not the default,
45  * and second, SA_RESTART does what you'd expect (the same as svr4) and has
46  * nothing to do with SA_ONESHOT.
47  */
48 #ifndef SA_INTERRUPT
49 #define SA_INTERRUPT    0
50 #endif /* SA_INTERRUPT */
51 #endif /* linux */
52
53 #ifdef ultrix 
54 #include <sys/types.h>
55 #include <netinet/in.h>
56 #include <arpa/inet.h>
57
58 /*
59  * Here's the really confusing one...  Under Ultrix, sigaction() works just
60  * like sigvec(), except that SV_INTERRUPT is always set.  Hence, there is
61  * no SA_INTERRUPT flag.  Unfortunately, there's also no SA_RESTART, so
62  * there's no way to suppress the interrupt.  Sigh.
63  */
64 #ifndef SA_INTERRUPT
65 #define SA_INTERRUPT    0
66 #endif
67 #ifndef SA_RESTART
68 #define SA_RESTART      0
69 #endif
70
71 extern char *strdup __P((const char *));
72 extern int inet_aton __P((const char *, struct in_addr *));
73 #endif /* ultrix */
74
75 #ifdef BSD4_4
76 #ifndef SA_INTERRUPT
77 #define SA_INTERRUPT    0
78 #endif
79 #endif /* BSD4_4 */
80
81 #if defined(ultrix) || defined(_IBMR2) || defined(NEED_GETUSERSHELL)
82 extern char *getusershell __P((void));
83 #endif
84
85 #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
86 #include <stdio.h>
87 #include <stdarg.h>
88 #endif
89
90 #ifndef HAVE_SNPRINTF
91 int snprintf (char *str,size_t count,const char *fmt,...);
92 #endif
93
94 #ifndef HAVE_VSNPRINTF
95 int vsnprintf(char *str, size_t count, const char *fmt, va_list args);
96 #endif