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 <sys/cdefs.h> 10#include <signal.h> 11 12#ifdef __svr4__ 13/* 14 * SunOS 5 (solaris) has SA_RESTART, but no SA_INTERRUPT. 15 */ 16#ifndef SA_INTERRUPT 17#define SA_INTERRUPT 0 18#endif 19 20#include <sys/types.h> 21#include <netinet/in.h> 22#include <arpa/inet.h> 23 24extern int flock (int, int); 25extern int inet_aton (const char *, struct in_addr *); 26#else /* __svr4__ */ 27 28#ifdef sun 29/* 30 * SunOS 4 has SA_INTERRUPT, but no SA_RESTART. 31 */ 32#ifndef SA_RESTART 33#define SA_RESTART 0 34#endif 35#endif /* sun */ 36 37#endif /* __svr4__ */ 38 39#ifdef linux 40/* 41 * Linux has SA_RESTART, but no SA_INTERRUPT. Note that the documentation 42 * seems to be wrong on several counts. First, SA_ONESHOT is not the default, 43 * and second, SA_RESTART does what you'd expect (the same as svr4) and has 44 * nothing to do with SA_ONESHOT. 45 */ 46#ifndef SA_INTERRUPT 47#define SA_INTERRUPT 0 48#endif /* SA_INTERRUPT */ 49#endif /* linux */ 50 51#ifdef ultrix 52#include <sys/types.h> 53#include <netinet/in.h> 54#include <arpa/inet.h> 55 56/* 57 * Here's the really confusing one... Under Ultrix, sigaction() works just 58 * like sigvec(), except that SV_INTERRUPT is always set. Hence, there is 59 * no SA_INTERRUPT flag. Unfortunately, there's also no SA_RESTART, so 60 * there's no way to suppress the interrupt. Sigh. 61 */ 62#ifndef SA_INTERRUPT 63#define SA_INTERRUPT 0 64#endif 65#ifndef SA_RESTART 66#define SA_RESTART 0 67#endif 68 69extern char *strdup (const char *); 70extern int inet_aton (const char *, struct in_addr *); 71#endif /* ultrix */ 72 73#ifdef BSD4_4 74#ifndef SA_INTERRUPT 75#define SA_INTERRUPT 0 76#endif 77#endif /* BSD4_4 */ 78 79#if defined(ultrix) || defined(_IBMR2) || defined(NEED_GETUSERSHELL) 80extern char *getusershell (void); 81#endif 82 83#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) 84#include <stdio.h> 85#include <stdarg.h> 86#endif 87 88#ifndef HAVE_SNPRINTF 89int snprintf (char *str,size_t count,const char *fmt,...); 90#endif 91 92#ifndef HAVE_VSNPRINTF 93int vsnprintf(char *str, size_t count, const char *fmt, va_list args); 94#endif 95 96/* OpenBSD */ 97#if defined(__OpenBSD__) && !defined(ENOTSUP) 98#define ENOTSUP EOPNOTSUPP 99#endif 100 101#if !defined(HAVE_PSELECT) || defined(__OpenBSD__) 102extern int pselect(int, fd_set * restrict, fd_set * restrict, 103 fd_set * restrict, const struct timespec * restrict, 104 const sigset_t * restrict); 105#endif 106