pull getpwXXX and gethostbyXXX calls out into conf.c so they can
[unix-history] / usr / src / usr.sbin / sendmail / src / conf.h
index 8e1f16e..8f780e4 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)conf.h      8.117 (Berkeley) %G%
+ *     @(#)conf.h      8.143 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -19,6 +19,8 @@
 # include <sys/wait.h>
 # include <fcntl.h>
 # include <signal.h>
 # include <sys/wait.h>
 # include <fcntl.h>
 # include <signal.h>
+# include <netdb.h>
+# include <pwd.h>
 
 /**********************************************************************
 **  Table sizes, etc....
 
 /**********************************************************************
 **  Table sizes, etc....
@@ -30,7 +32,7 @@
 # define MAXPV         40              /* max # of parms to mailers */
 # define MAXATOM       200             /* max atoms per address */
 # define MAXMAILERS    25              /* maximum mailers known to system */
 # define MAXPV         40              /* max # of parms to mailers */
 # define MAXATOM       200             /* max atoms per address */
 # define MAXMAILERS    25              /* maximum mailers known to system */
-# define MAXRWSETS     100             /* max # of sets of rewriting rules */
+# define MAXRWSETS     200             /* max # of sets of rewriting rules */
 # define MAXPRIORITIES 25              /* max values for Precedence: field */
 # define MAXMXHOSTS    20              /* max # of MX records */
 # define SMTPLINELIM   990             /* maximum SMTP line length */
 # define MAXPRIORITIES 25              /* max values for Precedence: field */
 # define MAXMXHOSTS    20              /* max # of MX records */
 # define SMTPLINELIM   990             /* maximum SMTP line length */
@@ -40,6 +42,8 @@
 # define MAXALIASDB    12              /* max # of alias databases */
 # define MAXMAPSTACK   12              /* max # of stacked or sequenced maps */
 # define MAXTOCLASS    8               /* max # of message timeout classes */
 # define MAXALIASDB    12              /* max # of alias databases */
 # define MAXMAPSTACK   12              /* max # of stacked or sequenced maps */
 # define MAXTOCLASS    8               /* max # of message timeout classes */
+# define MAXMIMEARGS   20              /* max args in Content-Type: */
+# define MAXMIMENESTING        20              /* max MIME multipart nesting */
 
 # ifndef QUEUESIZE
 # define QUEUESIZE     1000            /* max # of jobs per queue run */
 
 # ifndef QUEUESIZE
 # define QUEUESIZE     1000            /* max # of jobs per queue run */
@@ -55,7 +59,6 @@
 # define UGLYUUCP      1       /* output ugly UUCP From lines */
 # define NETUNIX       1       /* include unix domain support */
 # define NETINET       1       /* include internet support */
 # define UGLYUUCP      1       /* output ugly UUCP From lines */
 # define NETUNIX       1       /* include unix domain support */
 # define NETINET       1       /* include internet support */
-# define SETPROCTITLE  1       /* munge argv to display current status */
 # define MATCHGECOS    1       /* match user names from gecos field */
 # define XDEBUG                1       /* enable extended debugging */
 # ifdef NEWDB
 # define MATCHGECOS    1       /* match user names from gecos field */
 # define XDEBUG                1       /* enable extended debugging */
 # ifdef NEWDB
 # define HASINITGROUPS 1       /* has initgroups(3) call */
 # define HASSETREUID   1       /* has setreuid(2) call */
 # define setreuid(r, e)                setresuid(r, e, -1)
 # define HASINITGROUPS 1       /* has initgroups(3) call */
 # define HASSETREUID   1       /* has setreuid(2) call */
 # define setreuid(r, e)                setresuid(r, e, -1)
-# define LA_TYPE       LA_FLOAT
+# define LA_TYPE       LA_SUBR
 # define SFS_TYPE      SFS_VFS /* use <sys/vfs.h> statfs() implementation */
 # define GIDSET_T      gid_t
 # define _PATH_UNIX    "/hp-ux"
 # define SFS_TYPE      SFS_VFS /* use <sys/vfs.h> statfs() implementation */
 # define GIDSET_T      gid_t
 # define _PATH_UNIX    "/hp-ux"
@@ -147,6 +150,8 @@ extern int  syslog(int, char *, ...);
 # define HASGETUSERSHELL 0     /* does not have getusershell(3) call */
 # define FORK          fork    /* no vfork primitive available */
 # define SFS_TYPE      SFS_STATFS      /* use <sys/statfs.h> statfs() impl */
 # define HASGETUSERSHELL 0     /* does not have getusershell(3) call */
 # define FORK          fork    /* no vfork primitive available */
 # define SFS_TYPE      SFS_STATFS      /* use <sys/statfs.h> statfs() impl */
+# define SPT_PADCHAR   '\0'    /* pad process title with nulls */
+# define LA_TYPE       LA_INT
 #endif
 
 
 #endif
 
 
@@ -154,20 +159,37 @@ extern int        syslog(int, char *, ...);
 **  Silicon Graphics IRIX
 **
 **     Compiles on 4.0.1.
 **  Silicon Graphics IRIX
 **
 **     Compiles on 4.0.1.
+**
+**     Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
+**     Use IRIX5 instead of IRIX for IRIX 5.x.
+**
+**     IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
+**     IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
 */
 
 */
 
+#if defined(IRIX64) || defined(IRIX5)
+# define IRIX
+#endif
+
 #ifdef IRIX
 # define SYSTEM5       1       /* this is a System-V derived system */
 # define HASSETREUID   1       /* has setreuid(2) call */
 # define HASINITGROUPS 1       /* has initgroups(3) call */
 # define HASGETUSERSHELL 0     /* does not have getusershell(3) call */
 # define FORK          fork    /* no vfork primitive available */
 #ifdef IRIX
 # define SYSTEM5       1       /* this is a System-V derived system */
 # define HASSETREUID   1       /* has setreuid(2) call */
 # define HASINITGROUPS 1       /* has initgroups(3) call */
 # define HASGETUSERSHELL 0     /* does not have getusershell(3) call */
 # define FORK          fork    /* no vfork primitive available */
-# define WAITUNION     1       /* use "union wait" as wait argument type */
+# if !defined(IRIX64) && !defined(IRIX5)
+#  define WAITUNION    1       /* use "union wait" as wait argument type */
+# endif
 # define setpgid       BSDsetpgrp
 # define GIDSET_T      gid_t
 # define SFS_TYPE      SFS_4ARGS       /* four argument statfs() call */
 # define setpgid       BSDsetpgrp
 # define GIDSET_T      gid_t
 # define SFS_TYPE      SFS_4ARGS       /* four argument statfs() call */
+# define SFS_BAVAIL    f_bfree         /* alternate field name */
 # define LA_TYPE       LA_INT
 # define LA_TYPE       LA_INT
-# define NAMELISTMASK  0x7fffffff      /* mask for nlist() values */
+# ifdef IRIX64
+#  define NAMELISTMASK 0x7fffffffffffffff      /* mask for nlist() values */
+# else
+#  define NAMELISTMASK 0x7fffffff              /* mask for nlist() values */
+# endif
 #endif
 
 
 #endif
 
 
@@ -186,7 +208,7 @@ extern int  syslog(int, char *, ...);
 # define LA_TYPE       LA_INT
 
 # ifdef SOLARIS_2_3
 # define LA_TYPE       LA_INT
 
 # ifdef SOLARIS_2_3
-#  define SOLARIS
+#  define SOLARIS              /* for back compat only -- use -DSOLARIS=203 */
 # endif
 
 # ifdef SOLARIS
 # endif
 
 # ifdef SOLARIS
@@ -195,8 +217,6 @@ extern int  syslog(int, char *, ...);
 #   define __svr4__            /* use all System V Releae 4 defines below */
 #  endif
 #  include <sys/time.h>
 #   define __svr4__            /* use all System V Releae 4 defines below */
 #  endif
 #  include <sys/time.h>
-#  define gethostbyname        solaris_gethostbyname   /* get working version */
-#  define gethostbyaddr        solaris_gethostbyaddr   /* get working version */
 #  define GIDSET_T     gid_t
 #  ifndef _PATH_UNIX
 #   define _PATH_UNIX  "/dev/ksyms"
 #  define GIDSET_T     gid_t
 #  ifndef _PATH_UNIX
 #   define _PATH_UNIX  "/dev/ksyms"
@@ -210,6 +230,10 @@ extern int syslog(int, char *, ...);
 #  ifndef SYSLOG_BUFSIZE
 #   define SYSLOG_BUFSIZE      1024    /* allow full size syslog buffer */
 #  endif
 #  ifndef SYSLOG_BUFSIZE
 #   define SYSLOG_BUFSIZE      1024    /* allow full size syslog buffer */
 #  endif
+#  if SOLARIS < 204
+#   define gethostbyname       solaris_gethostbyname   /* get good version */
+#   define gethostbyaddr       solaris_gethostbyaddr   /* get good version */
+#  endif
 
 # else
                        /* SunOS 4.0.3 or 4.1.x */
 
 # else
                        /* SunOS 4.0.3 or 4.1.x */
@@ -264,7 +288,7 @@ extern char         *getenv();
 # ifndef IDENTPROTO
 #  define IDENTPROTO   0       /* TCP/IP implementation is broken */
 # endif
 # ifndef IDENTPROTO
 #  define IDENTPROTO   0       /* TCP/IP implementation is broken */
 # endif
-# undef SETPROCTITLE
+# define SPT_TYPE      SPT_NONE        /* don't use setproctitle */
 # define SFS_TYPE      SFS_4ARGS       /* four argument statfs() call */
 
 /* these include files must be included early on DG/UX */
 # define SFS_TYPE      SFS_4ARGS       /* four argument statfs() call */
 
 /* these include files must be included early on DG/UX */
@@ -309,6 +333,21 @@ extern long        dgux_inet_addr();
 #endif
 
 
 #endif
 
 
+/*
+**  OSF/1 for Intel Paragon.
+**
+**     Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
+**     of Intel Scalable Systems Divison.
+*/
+
+#ifdef __PARAGON__
+# define __osf__       1       /* get OSF/1 defines below */
+# ifndef _PATH_SENDMAILCF
+#  define _PATH_SENDMAILCF     "/var/adm/sendmail/sendmail.cf"
+# endif
+#endif
+
+
 /*
 **  OSF/1 (tested on Alpha)
 */
 /*
 **  OSF/1 (tested on Alpha)
 */
@@ -373,6 +412,7 @@ typedef int         pid_t;
 #  define LA_TYPE      LA_SUBR
 # endif
 # define SFS_TYPE      SFS_MOUNT       /* use <sys/mount.h> statfs() impl */
 #  define LA_TYPE      LA_SUBR
 # endif
 # define SFS_TYPE      SFS_MOUNT       /* use <sys/mount.h> statfs() impl */
+# define SPT_TYPE      SPT_PSSTRINGS   /* use PS_STRINGS pointer */
 #endif
 
 
 #endif
 
 
@@ -392,13 +432,14 @@ typedef int               pid_t;
 # endif
 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
                        /* version 1.1 or later */
 # endif
 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
                        /* version 1.1 or later */
-#  define HASSETPROCTITLE 1    /* setproctitle is in libc */
-#  undef SETPROCTITLE          /* so don't redefine it in conf.c */
+#  undef SPT_TYPE
+#  define SPT_TYPE     SPT_BUILTIN     /* setproctitle is in libc */
 # else
                        /* version 1.0 or earlier */
 #  ifndef OLD_NEWDB
 #   define OLD_NEWDB   1       /* old version of newdb library */
 #  endif
 # else
                        /* version 1.0 or earlier */
 #  ifndef OLD_NEWDB
 #   define OLD_NEWDB   1       /* old version of newdb library */
 #  endif
+#  define SPT_PADCHAR  '\0'    /* pad process title with nulls */
 # endif
 #endif
 
 # endif
 #endif
 
@@ -517,9 +558,71 @@ extern int         errno;
 # define FORK          fork
 # define MAXPATHLEN    PATHSIZE
 # define LA_TYPE       LA_SHORT
 # define FORK          fork
 # define MAXPATHLEN    PATHSIZE
 # define LA_TYPE       LA_SHORT
+# define SFS_TYPE      SFS_4ARGS       /* use <sys/statfs.h> 4-arg impl */
+# define SFS_BAVAIL    f_bfree         /* alternate field name */
+# define TZ_TYPE       TZ_TM_NAME      /* use tm->tm_name */
+# undef NETUNIX                        /* no unix domain socket support */
+#endif
+
+
+/*
+**  ISC (SunSoft) Unix.
+**
+**     Contributed by J.J. Bailey <jjb@jagware.bcc.com>
+*/
+
+#ifdef ISC_UNIX
+# include <net/errno.h>
+# define SYSTEM5       1       /* include all the System V defines */
+# define SYS5SIGNALS   1       /* SysV signal semantics -- reset on each sig */
+# define HASGETUSERSHELL 0     /* does not have getusershell(3) call */
+# define HASSETREUID   1       /* has setreuid(2) call */
+# define NEEDFSYNC     1       /* needs the fsync(2) call stub */
+# undef NETUNIX                        /* no unix domain socket support */
+# define FORK          fork
+# define MAXPATHLEN    1024
+# define LA_TYPE       LA_SHORT
+# define SFS_TYPE      SFS_STATFS      /* use <sys/statfs.h> statfs() impl */
+# define SFS_BAVAIL    f_bfree         /* alternate field name */
+# define _PATH_UNIX    "/unix"
+# ifndef _PATH_SENDMAILCF
+#  define _PATH_SENDMAILCF     "/usr/lib/sendmail.cf"
+# endif
+# ifndef _PATH_SENDMAILPID
+#  define _PATH_SENDMAILPID    "/etc/sendmail.pid"
+# endif
+
+typedef short          pid_t;
+
+#endif
+
+
+/*
+**  Altos System V.
+**     Contributed by Tim Rice <timr@crl.com>.
+*/
+
+#ifdef ALTOS_SYS_V
+# include <limits.h>
+# define SYSTEM5       1       /* include all the System V defines */
+# define SYS5SIGNALS   1       /* SysV signal semantics -- reset on each sig */
+# define HASGETUSERSHELL 0     /* does not have getusershell(3) call */
+# define WAITUNION     1       /* use "union wait" as wait argument type */
+# define NEEDFSYNC     1       /* no fsync(2) in system library */
+# define FORK          fork
+# define MAXPATHLEN    PATHSIZE
+# define LA_TYPE       LA_SHORT
 # define SFS_TYPE      SFS_STATFS      /* use <sys/statfs.h> statfs() impl */
 # define SFS_TYPE      SFS_STATFS      /* use <sys/statfs.h> statfs() impl */
+# define SFS_BAVAIL    f_bfree         /* alternate field name */
 # define TZ_TYPE       TZ_TM_NAME      /* use tm->tm_name */
 # undef NETUNIX                        /* no unix domain socket support */
 # define TZ_TYPE       TZ_TM_NAME      /* use tm->tm_name */
 # undef NETUNIX                        /* no unix domain socket support */
+# undef WIFEXITED
+# undef WEXITSTATUS
+# define strtoul       strtol  /* gcc library bogosity */
+
+typedef unsigned short uid_t;
+typedef unsigned short gid_t;
+typedef short          pid_t;
 #endif
 
 
 #endif
 
 
@@ -591,13 +694,14 @@ extern void               *malloc();
 **  Thanks to, in reverse order of contact:
 **
 **     John Kennedy <warlock@csuchico.edu>
 **  Thanks to, in reverse order of contact:
 **
 **     John Kennedy <warlock@csuchico.edu>
+**     Andrew Pam <avatar@aus.xanadu.com>
 **     Florian La Roche <rzsfl@rz.uni-sb.de>
 **     Karl London <karl@borg.demon.co.uk>
 **
 **     Florian La Roche <rzsfl@rz.uni-sb.de>
 **     Karl London <karl@borg.demon.co.uk>
 **
-**  Last compiled against:     [03/02/94 @ 05:34 PM (Wednesday)]
-**     sendmail 8.6.6.b9       named 4.9.2-931205-p1   db-1.73
-**     gcc 2.5.8               libc.so.4.5.19
-**     slackware 1.1.2         linux 0.99.15
+**  Last compiled against:     [12/14/94 @ 11:38:41 PM (Wednesday)]
+**     sendmail 8.7.a.5        named 4.9.3-beta12-p1   db-1.85
+**     gcc 2.6.2               libc.so.4.6.20
+**     slackware 2.1.0         linux 1.1.70
 */
 
 #ifdef __linux__
 */
 
 #ifdef __linux__
@@ -607,10 +711,18 @@ extern void               *malloc();
 # define HASUNSETENV   1       /* has unsetenv(3) call */
 # define ERRLIST_PREDEFINED    /* don't declare sys_errlist */
 # define GIDSET_T      gid_t   /* from <linux/types.h> */
 # define HASUNSETENV   1       /* has unsetenv(3) call */
 # define ERRLIST_PREDEFINED    /* don't declare sys_errlist */
 # define GIDSET_T      gid_t   /* from <linux/types.h> */
+# define HASGETUSERSHELL 0     /* getusershell(3) broken in Slackware 2.0 */
+# ifndef HASFLOCK
+#  define HASFLOCK     0       /* flock(2) is broken after 0.99.13 */
+# endif
 # ifndef LA_TYPE
 #  define LA_TYPE      LA_PROCSTR
 # endif
 # define SFS_TYPE      SFS_VFS         /* use <sys/vfs.h> statfs() impl */
 # ifndef LA_TYPE
 #  define LA_TYPE      LA_PROCSTR
 # endif
 # define SFS_TYPE      SFS_VFS         /* use <sys/vfs.h> statfs() impl */
+# ifndef _PATH_SENDMAILPID
+#  define _PATH_SENDMAILPID    "/var/run/sendmail.pid"
+# endif
+# define TZ_TYPE       TZ_TNAME
 # include <sys/sysmacros.h>
 # undef atol                   /* wounded in <stdlib.h> */
 #endif
 # include <sys/sysmacros.h>
 # undef atol                   /* wounded in <stdlib.h> */
 #endif
@@ -760,7 +872,7 @@ typedef int         pid_t;
 # define GIDSET_T      gid_t
 # define LA_TYPE       LA_INT
 # define SFS_TYPE      SFS_STATFS      /* use <sys/statfs.h> statfs() impl */
 # define GIDSET_T      gid_t
 # define LA_TYPE       LA_INT
 # define SFS_TYPE      SFS_STATFS      /* use <sys/statfs.h> statfs() impl */
-# undef SETPROCTITLE
+# define SPT_TYPE      SPT_NONE        /* don't use setproctitle */
 # ifndef IDENTPROTO
 #  define IDENTPROTO   0       /* TCP/IP implementation is broken */
 # endif
 # ifndef IDENTPROTO
 #  define IDENTPROTO   0       /* TCP/IP implementation is broken */
 # endif
@@ -785,6 +897,7 @@ typedef int         pid_t;
 # define MAXPATHLEN    PATHSIZE
 # define LA_TYPE       LA_ZERO
 # define SFS_TYPE      SFS_4ARGS       /* four argument statfs() call */
 # define MAXPATHLEN    PATHSIZE
 # define LA_TYPE       LA_ZERO
 # define SFS_TYPE      SFS_4ARGS       /* four argument statfs() call */
+# define SFS_BAVAIL    f_bfree         /* alternate field name */
 #endif
 
 
 #endif
 
 
@@ -800,9 +913,10 @@ typedef int                pid_t;
 #ifdef apollo
 # define HASSETREUID   1       /* has setreuid(2) call */
 # define HASINITGROUPS 1       /* has initgroups(2) call */
 #ifdef apollo
 # define HASSETREUID   1       /* has setreuid(2) call */
 # define HASINITGROUPS 1       /* has initgroups(2) call */
-# undef  SETPROCTITLE
+# define SPT_TYPE      SPT_NONE        /* don't use setproctitle */
 # define LA_TYPE       LA_SUBR         /* use getloadavg.c */
 # define SFS_TYPE      SFS_4ARGS       /* four argument statfs() call */
 # define LA_TYPE       LA_SUBR         /* use getloadavg.c */
 # define SFS_TYPE      SFS_4ARGS       /* four argument statfs() call */
+# define SFS_BAVAIL    f_bfree         /* alternate field name */
 # ifndef _PATH_SENDMAILCF
 #  define _PATH_SENDMAILCF     "/usr/lib/sendmail.cf"
 # endif
 # ifndef _PATH_SENDMAILCF
 #  define _PATH_SENDMAILCF     "/usr/lib/sendmail.cf"
 # endif
@@ -819,18 +933,20 @@ typedef int               pid_t;
 
 
 /*
 
 
 /*
-**  UnixWare
+**  UnixWare 1.1.2.
 **
 **     From Evan Champion <evanc@spatial.synapse.org>.
 */
 
 #ifdef UNIXWARE
 # define SYSTEM5               1
 **
 **     From Evan Champion <evanc@spatial.synapse.org>.
 */
 
 #ifdef UNIXWARE
 # define SYSTEM5               1
-# ifndef HASGETUSERSHELL
-#  define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
-# endif
-# define GIDSET_T              int
-# define SLEEP_T               int
+# define HASGETUSERSHELL       0       /* does not have getusershell(3) call */
+# define HASGETDTABLESIZE      1
+# define HASSETREUID           1
+# define HASSETSID             1
+# define HASINITGROUPS         1
+# define GIDSET_T              gid_t
+# define SLEEP_T               unsigned
 # define SFS_TYPE              SFS_STATVFS
 # define LA_TYPE               LA_ZERO
 # undef WIFEXITED
 # define SFS_TYPE              SFS_STATVFS
 # define LA_TYPE               LA_ZERO
 # undef WIFEXITED
@@ -929,6 +1045,53 @@ extern int        syslog(int, char *, ...);
 #endif
 
 
 #endif
 
 
+/*
+**  Amdahl UTS System V 2.1.5 (SVr3-based)
+**
+**    From: Janet Jackson <janet@dialix.oz.au>.
+*/
+
+#ifdef _UTS
+# include <sys/sysmacros.h>
+# undef HASLSTAT       /* has symlinks, but they cause problems */
+# define NEEDFSYNC     1       /* system fsync(2) fails on non-EFS filesys */
+# define SYS5SIGNALS   1       /* System V signal semantics */
+# define SYS5SETPGRP   1       /* use System V setpgrp(2) syscall */
+# define HASUNAME      1       /* use System V uname(2) system call */
+# define HASINITGROUPS 1       /* has initgroups(3) function */
+# define HASSETVBUF    1       /* has setvbuf(3) function */
+# define HASSIGSETMASK 0       /* does not have sigsetmask(2) function */
+# ifndef HASGETUSERSHELL
+#  define HASGETUSERSHELL 0    /* does not have getusershell(3) function */
+# endif
+# define GIDSET_T      gid_t   /* type of 2nd arg to getgroups(2) isn't int */
+# define LA_TYPE       LA_ZERO         /* doesn't have load average */
+# define SFS_TYPE      SFS_4ARGS       /* use 4-arg statfs() */
+# define SFS_BAVAIL    f_bfree         /* alternate field name */
+# define _PATH_UNIX    "/unix"
+# ifndef _PATH_SENDMAILCF
+#  define _PATH_SENDMAILCF     "/usr/lib/sendmail.cf"
+# endif
+#endif
+
+/*
+**  Cray Computer Corporation's CSOS
+**
+**     Contributed by Scott Bolte <scott@craycos.com>.
+*/
+
+#ifdef _CRAYCOM
+# define SYSTEM5       1       /* include all the System V defines */
+# define SYS5SIGNALS   1       /* SysV signal semantics -- reset on each sig */
+# define NEEDFSYNC     1       /* no fsync in system library */
+# define MAXPATHLEN    PATHSIZE
+# define LA_TYPE       LA_ZERO
+# define SFS_TYPE      SFS_4ARGS       /* four argument statfs() call */
+# define SFS_BAVAIL    f_bfree         /* alternate field name */
+# define _POSIX_CHOWN_RESTRICTED       -1
+extern struct group    *getgrent(), *getgrnam(), *getgrgid();
+#endif
+
 
 /**********************************************************************
 **  End of Per-Operating System defines
 
 /**********************************************************************
 **  End of Per-Operating System defines
@@ -942,7 +1105,7 @@ extern int syslog(int, char *, ...);
 #ifdef BSD
 # define HASGETDTABLESIZE 1    /* has getdtablesize(2) call */
 # define HASSETREUID   1       /* has setreuid(2) call */
 #ifdef BSD
 # define HASGETDTABLESIZE 1    /* has getdtablesize(2) call */
 # define HASSETREUID   1       /* has setreuid(2) call */
-# define HASINITGROUPS 1       /* has initgroups(2) call */
+# define HASINITGROUPS 1       /* has initgroups(3) call */
 # ifndef HASSETRLIMIT
 #  define HASSETRLIMIT 1       /* has setrlimit(2) call */
 # endif
 # ifndef HASSETRLIMIT
 #  define HASSETRLIMIT 1       /* has setrlimit(2) call */
 # endif
@@ -958,6 +1121,10 @@ extern int        syslog(int, char *, ...);
 #ifdef __svr4__
 # define SYSTEM5       1
 # define HASSETREUID   1       /* has seteuid(2) call & working saved uids */
 #ifdef __svr4__
 # define SYSTEM5       1
 # define HASSETREUID   1       /* has seteuid(2) call & working saved uids */
+# define HASINITGROUPS 1       /* has initgroups(3) call */
+# ifndef HASSETRLIMIT
+#  define HASSETRLIMIT 1       /* has setrlimit(2) call */
+# endif
 # ifndef HASGETUSERSHELL
 #  define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
 # endif
 # ifndef HASGETUSERSHELL
 #  define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
 # endif
@@ -1020,14 +1187,28 @@ extern int      syslog(int, char *, ...);
 #endif
 
 /*
 #endif
 
 /*
-**  Tweaking for systems that (for example) claim to be BSD but
-**  don't have all the standard BSD routines (boo hiss).
+**  Tweaking for systems that (for example) claim to be BSD or POSIX
+**  but don't have all the standard BSD or POSIX routines (boo hiss).
 */
 
 #ifdef titan
 # undef HASINITGROUPS          /* doesn't have initgroups(3) call */
 #endif
 
 */
 
 #ifdef titan
 # undef HASINITGROUPS          /* doesn't have initgroups(3) call */
 #endif
 
+#ifdef _CRAYCOM
+# undef HASSETSID              /* despite POSIX claim, doesn't have setsid */
+#endif
+
+#ifdef ISC_UNIX
+# undef bcopy                  /* despite SystemV claim, uses BSD bcopy */
+#endif
+
+#ifdef ALTOS_SYS_V
+# undef bcopy                  /* despite SystemV claim, uses BSD bcopy */
+# undef bzero                  /* despite SystemV claim, uses BSD bzero */
+# undef bcmp                   /* despite SystemV claim, uses BSD bcmp */
+#endif
+
 
 /*
 **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
 
 /*
 **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
@@ -1064,6 +1245,15 @@ extern int       syslog(int, char *, ...);
 # define OLD_NEWDB     0       /* assume newer version of newdb */
 #endif
 
 # define OLD_NEWDB     0       /* assume newer version of newdb */
 #endif
 
+/* heuristic setting of HASSETSIGMASK; can override above */
+#ifndef HASSIGSETMASK
+# ifdef SIGVTALRM
+#  define HASSETSIGMASK        1
+# else
+#  define HASSETSIGMASK        0
+# endif
+#endif
+
 
 /**********************************************************************
 **  Remaining definitions should never have to be changed.  They are
 
 /**********************************************************************
 **  Remaining definitions should never have to be changed.  They are
@@ -1078,11 +1268,14 @@ extern int      syslog(int, char *, ...);
 #if !defined(S_ISLNK) && defined(S_IFLNK)
 # define S_ISLNK(foo)  ((foo & S_IFMT) == S_IFLNK)
 #endif
 #if !defined(S_ISLNK) && defined(S_IFLNK)
 # define S_ISLNK(foo)  ((foo & S_IFMT) == S_IFLNK)
 #endif
+#ifndef S_IWUSR
+# define S_IWUSR               0200
+#endif
 #ifndef S_IWGRP
 #ifndef S_IWGRP
-#define S_IWGRP                020
+# define S_IWGRP               0020
 #endif
 #ifndef S_IWOTH
 #endif
 #ifndef S_IWOTH
-#define S_IWOTH                002
+# define S_IWOTH               0002
 #endif
 
 /*
 #endif
 
 /*
@@ -1197,7 +1390,7 @@ struct utsname
 };
 #endif /* HASUNAME */
 
 };
 #endif /* HASUNAME */
 
-#if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX)
+#if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V)
 # define MAXHOSTNAMELEN        256
 #endif
 
 # define MAXHOSTNAMELEN        256
 #endif