1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
/*
* Copyright (c) 1996 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*
* NOTE: SunOS 4 and ultrix are pretty much the only reason why there
* 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 __P((int, int));
extern int inet_aton __P((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
extern char *strdup __P((const char *));
extern int inet_aton __P((const char *, struct in_addr *));
#endif /* ultrix */
#ifdef BSD4_4
#ifndef SA_INTERRUPT
#define SA_INTERRUPT 0
#endif
#endif /* BSD4_4 */
#if defined(ultrix) || defined(_IBMR2) || defined(NEED_GETUSERSHELL)
extern char *getusershell __P((void));
#endif
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
#include <stdio.h>
#include <stdarg.h>
#endif
#ifndef HAVE_SNPRINTF
int snprintf (char *str,size_t count,const char *fmt,...);
#endif
#ifndef HAVE_VSNPRINTF
int vsnprintf(char *str, size_t count, const char *fmt, va_list args);
#endif
|