SCCS-vsn: usr.sbin/sendmail/src/conf.h 8.77
SCCS-vsn: usr.sbin/sendmail/src/conf.c 8.64
-static char sccsid[] = "@(#)conf.c 8.63 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c 8.64 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
** Puts the filesystem block size into bsize.
*/
** Puts the filesystem block size into bsize.
*/
-#ifdef HASSTATFS
-# undef HASUSTAT
+/* statfs types */
+#define SFS_NONE 0 /* no statfs implementation */
+#define SFS_USTAT 1 /* use ustat */
+#define SFS_4ARGS 2 /* use four-argument statfs call */
+#define SFS_VFS 3 /* use <sys/vfs.h> implementation */
+#define SFS_MOUNT 4 /* use <sys/mount.h> implementation */
+#define SFS_STATFS 5 /* use <sys/statfs.h> implementation */
+
+#ifndef SFS_TYPE
+# define SFS_TYPE SFS_NONE
+#if SFS_TYPE == SFS_USTAT
# include <ustat.h>
#endif
# include <ustat.h>
#endif
-
-#ifdef HASSTATFS
-# if defined(IRIX) || defined(apollo) || defined(_SCO_unix_) || defined(UMAXV) || defined(DGUX) || defined(_AIX3)
-# include <sys/statfs.h>
-# else
-# if (defined(sun) && !defined(BSD)) || defined(__hpux) || defined(_CONVEX_SOURCE) || defined(NeXT) || defined(_AUX_SOURCE) || defined(MACH386)
-# include <sys/vfs.h>
-# else
-# include <sys/mount.h>
-# endif
-# endif
+#if SFS_TYPE == SFS_4ARGS || SFS_TYPE == SFS_STATFS
+# include <sys/statfs.h>
+#endif
+#if SFS_TYPE == SFS_VFS
+# include <sys/vfs.h>
+#endif
+#if SFS_TYPE == SFS_MOUNT
+# include <sys/mount.h>
char *dir;
long *bsize;
{
char *dir;
long *bsize;
{
-#if defined(HASSTATFS) || defined(HASUSTAT)
-# if defined(HASUSTAT)
+#if SFS_TYPE != SFS_NONE
+# if SFS_TYPE == SFS_USTAT
struct ustat fs;
struct stat statbuf;
# define FSBLOCKSIZE DEV_BSIZE
struct ustat fs;
struct stat statbuf;
# define FSBLOCKSIZE DEV_BSIZE
# endif
extern int errno;
# endif
extern int errno;
+# if SFS_TYPE == SFS_USTAT
if (stat(dir, &statbuf) == 0 && ustat(statbuf.st_dev, &fs) == 0)
# else
if (stat(dir, &statbuf) == 0 && ustat(statbuf.st_dev, &fs) == 0)
# else
-# if defined(IRIX) || defined(apollo) || defined(UMAXV) || defined(DGUX)
+# if SFS_TYPE == SFS_4ARGS
if (statfs(dir, &fs, sizeof fs, 0) == 0)
# else
# if defined(ultrix)
if (statfs(dir, &fs, sizeof fs, 0) == 0)
# else
# if defined(ultrix)
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)conf.h 8.76 (Berkeley) %G%
+ * @(#)conf.h 8.77 (Berkeley) %G%
# undef m_flags
# define SYSTEM5 1 /* include all the System V defines */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# undef m_flags
# define SYSTEM5 1 /* include all the System V defines */
# define HASINITGROUPS 1 /* has initgroups(3) call */
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# define HASSETREUID 1 /* has setreuid(2) call */
# define setreuid(r, e) setresuid(r, e, -1)
# define LA_TYPE LA_FLOAT
# define HASSETREUID 1 /* has setreuid(2) call */
# define setreuid(r, e) setresuid(r, e, -1)
# define LA_TYPE LA_FLOAT
+# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
# define GIDSET_T gid_t
# define _PATH_UNIX "/hp-ux"
# ifndef _PATH_SENDMAILCF
# define GIDSET_T gid_t
# define _PATH_UNIX "/hp-ux"
# ifndef _PATH_SENDMAILCF
# ifdef _AIX3
# define HASINITGROUPS 1 /* has initgroups(3) call */
# ifdef _AIX3
# define HASINITGROUPS 1 /* has initgroups(3) call */
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# define HASUNAME 1 /* use System V uname(2) system call */
# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
# define FORK fork /* no vfork primitive available */
# undef SETPROCTITLE /* setproctitle confuses AIX */
# define HASUNAME 1 /* use System V uname(2) system call */
# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
# define FORK fork /* no vfork primitive available */
# undef SETPROCTITLE /* setproctitle confuses AIX */
+# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
# include <sys/sysmacros.h>
# define HASSETREUID 1 /* has setreuid(2) call */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# include <sys/sysmacros.h>
# define HASSETREUID 1 /* has setreuid(2) call */
# define HASINITGROUPS 1 /* has initgroups(3) call */
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# 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 */
# define setpgid BSDsetpgrp
# define GIDSET_T gid_t
# 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 */
# define setpgid BSDsetpgrp
# define GIDSET_T gid_t
+# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
#if defined(sun) && !defined(BSD)
#if defined(sun) && !defined(BSD)
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define HASUNAME 1 /* use System V uname(2) system call */
# define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define HASUNAME 1 /* use System V uname(2) system call */
# define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */
# ifdef SOLARIS_2_3
# define SOLARIS
# ifdef SOLARIS_2_3
# define SOLARIS
# else
/* SunOS 4.0.3 or 4.1.x */
# define HASSETREUID 1 /* has setreuid(2) call */
# else
/* SunOS 4.0.3 or 4.1.x */
# define HASSETREUID 1 /* has setreuid(2) call */
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# define HASFLOCK 1 /* has flock(2) call */
# define HASFLOCK 1 /* has flock(2) call */
+# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
# include <vfork.h>
# ifdef SUNOS403
# include <vfork.h>
# ifdef SUNOS403
#ifdef DGUX
# define SYSTEM5 1
# define LA_TYPE LA_SUBR
#ifdef DGUX
# define SYSTEM5 1
# define LA_TYPE LA_SUBR
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# define HASSETREUID 1 /* has setreuid(2) call */
# define HASUNAME 1 /* use System V uname(2) system call */
# define HASSETSID 1 /* has Posix setsid(2) call */
# define HASSETREUID 1 /* has setreuid(2) call */
# define HASUNAME 1 /* use System V uname(2) system call */
# define HASSETSID 1 /* has Posix setsid(2) call */
# define IDENTPROTO 0 /* TCP/IP implementation is broken */
# endif
# undef SETPROCTITLE
# define IDENTPROTO 0 /* TCP/IP implementation is broken */
# endif
# undef SETPROCTITLE
+# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
/* these include files must be included early on DG/UX */
# include <netinet/in.h>
/* these include files must be included early on DG/UX */
# include <netinet/in.h>
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# define HASSETREUID 1 /* has setreuid(2) call */
# define HASUNSETENV 1 /* has unsetenv(3) call */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define HASSETREUID 1 /* has setreuid(2) call */
# define HASUNSETENV 1 /* has unsetenv(3) call */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define LA_TYPE LA_INT
# define LA_AVENRUN "avenrun"
# endif
# define LA_TYPE LA_INT
# define LA_AVENRUN "avenrun"
# endif
+# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
# ifndef IDENTPROTO
# define IDENTPROTO 0 /* TCP/IP implementation is broken */
# endif
# ifndef IDENTPROTO
# define IDENTPROTO 0 /* TCP/IP implementation is broken */
# endif
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# define HASUNSETENV 1 /* has unsetenv(3) call */
# define HASSETREUID 1 /* has setreuid(2) call */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define HASFLOCK 1 /* has flock(2) call */
# define LA_TYPE LA_INT
# define HASUNSETENV 1 /* has unsetenv(3) call */
# define HASSETREUID 1 /* has setreuid(2) call */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define HASFLOCK 1 /* has flock(2) call */
# define LA_TYPE LA_INT
+# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
# ifndef _PATH_SENDMAILPID
# define _PATH_SENDMAILPID "/var/run/sendmail.pid"
# endif
# ifndef _PATH_SENDMAILPID
# define _PATH_SENDMAILPID "/var/run/sendmail.pid"
# endif
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define HASFLOCK 1 /* has flock(2) call */
# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define HASFLOCK 1 /* has flock(2) call */
# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# define WAITUNION 1 /* use "union wait" as wait argument type */
# define sleep sleepX
# define setpgid setpgrp
# ifndef LA_TYPE
# define LA_TYPE LA_MACH
# endif
# define WAITUNION 1 /* use "union wait" as wait argument type */
# define sleep sleepX
# define setpgid setpgrp
# ifndef LA_TYPE
# define LA_TYPE LA_MACH
# endif
+# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
# ifndef _POSIX_SOURCE
typedef int pid_t;
# undef WEXITSTATUS
# ifndef _POSIX_SOURCE
typedef int pid_t;
# undef WEXITSTATUS
#ifdef BSD4_4
# define HASUNSETENV 1 /* has unsetenv(3) call */
#ifdef BSD4_4
# define HASUNSETENV 1 /* has unsetenv(3) call */
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# include <sys/cdefs.h>
# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
# ifndef LA_TYPE
# define LA_TYPE LA_SUBR
# endif
# include <sys/cdefs.h>
# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
# ifndef LA_TYPE
# define LA_TYPE LA_SUBR
# endif
+# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
#if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
# define HASUNSETENV 1 /* has unsetenv(3) call */
# define HASSETSID 1 /* has the setsid(2) POSIX syscall */
#if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
# define HASUNSETENV 1 /* has unsetenv(3) call */
# define HASSETSID 1 /* has the setsid(2) POSIX syscall */
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# include <sys/cdefs.h>
# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
# ifndef LA_TYPE
# define LA_TYPE LA_SUBR
# endif
# include <sys/cdefs.h>
# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
# ifndef LA_TYPE
# define LA_TYPE LA_SUBR
# endif
+# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
# define HASUNSETENV 1 /* has unsetenv(3) call */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define HASFLOCK 1 /* has flock(2) call */
# define HASUNSETENV 1 /* has unsetenv(3) call */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define HASFLOCK 1 /* has flock(2) call */
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
# define NEEDSTRTOL 1 /* need the strtol() function */
# define setpgid setpgrp
# ifndef LA_TYPE
# define LA_TYPE LA_FLOAT
# endif
# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
# define NEEDSTRTOL 1 /* need the strtol() function */
# define setpgid setpgrp
# ifndef LA_TYPE
# define LA_TYPE LA_FLOAT
# endif
+# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
# undef HASSETVBUF /* don't actually have setvbuf(3) */
# undef WEXITSTATUS
# undef WIFEXITED
# undef HASSETVBUF /* don't actually have setvbuf(3) */
# undef WEXITSTATUS
# undef WIFEXITED
#ifdef _SCO_unix_
# define SYSTEM5 1 /* include all the System V defines */
# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
#ifdef _SCO_unix_
# define SYSTEM5 1 /* include all the System V defines */
# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
# define FORK fork
# define MAXPATHLEN PATHSIZE
# define LA_TYPE LA_SHORT
# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
# define FORK fork
# define MAXPATHLEN PATHSIZE
# define LA_TYPE LA_SHORT
+# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
# undef NETUNIX /* no unix domain socket support */
#endif
# undef NETUNIX /* no unix domain socket support */
#endif
#ifdef _CONVEX_SOURCE
# define BSD 1 /* include all the BSD defines */
# define HASUNAME 1 /* use System V uname(2) system call */
#ifdef _CONVEX_SOURCE
# define BSD 1 /* include all the BSD defines */
# define HASUNAME 1 /* use System V uname(2) system call */
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# define HASSETSID 1 /* has POSIX setsid(2) call */
# define NEEDGETOPT 1 /* need replacement for getopt(3) */
# define LA_TYPE LA_FLOAT
# define HASSETSID 1 /* has POSIX setsid(2) call */
# define NEEDGETOPT 1 /* need replacement for getopt(3) */
# define LA_TYPE LA_FLOAT
+# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
# ifndef IDENTPROTO
# define IDENTPROTO 0 /* TCP/IP implementation is broken */
# endif
# ifndef IDENTPROTO
# define IDENTPROTO 0 /* TCP/IP implementation is broken */
# endif
#ifdef _AUX_SOURCE
# include <sys/sysmacros.h>
# define BSD /* has BSD routines */
#ifdef _AUX_SOURCE
# include <sys/sysmacros.h>
# define BSD /* has BSD routines */
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# define HASUNAME 1 /* use System V uname(2) system call */
# define HASUNAME 1 /* use System V uname(2) system call */
-# define HASUSTAT 1 /* use System V ustat(2) syscall */
# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
# define SIGFUNC_DEFINED /* sigfunc_t already defined */
# ifndef IDENTPROTO
# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
# define SIGFUNC_DEFINED /* sigfunc_t already defined */
# ifndef IDENTPROTO
# ifndef LA_TYPE
# define LA_TYPE LA_ZERO
# endif
# ifndef LA_TYPE
# define LA_TYPE LA_ZERO
# endif
+# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
# undef WIFEXITED
# undef WEXITSTATUS
#endif
# undef WIFEXITED
# undef WEXITSTATUS
#endif
#ifdef UMAXV
# include <limits.h>
# define HASUNAME 1 /* use System V uname(2) system call */
#ifdef UMAXV
# include <limits.h>
# define HASUNAME 1 /* use System V uname(2) system call */
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
# define FORK fork /* no vfork(2) primitive available */
# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
# define FORK fork /* no vfork(2) primitive available */
+# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
# define MAXPATHLEN PATH_MAX
extern struct passwd *getpwent(), *getpwnam(), *getpwuid();
extern struct group *getgrent(), *getgrnam(), *getgrgid();
# define MAXPATHLEN PATH_MAX
extern struct passwd *getpwent(), *getpwnam(), *getpwuid();
extern struct group *getgrent(), *getgrnam(), *getgrgid();
#ifdef UNICOS
# define SYSTEM5 1 /* include all the System V defines */
# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
#ifdef UNICOS
# define SYSTEM5 1 /* include all the System V defines */
# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
-# define HASSTATFS 1 /* has the statfs(2) syscall */
# define MAXPATHLEN PATHSIZE
# define LA_TYPE LA_ZERO
# define MAXPATHLEN PATHSIZE
# define LA_TYPE LA_ZERO
+# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
# ifdef SYSTEM5
# include <sys/sysmacros.h>
# define HASUNAME 1 /* use System V uname(2) system call */
# ifdef SYSTEM5
# include <sys/sysmacros.h>
# define HASUNAME 1 /* use System V uname(2) system call */
-# define HASUSTAT 1 /* use System V ustat(2) syscall */
# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
# ifndef LA_TYPE
# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
# ifndef LA_TYPE
+# define LA_TYPE LA_INT /* assume integer load average */
+# endif
+# ifndef SFS_TYPE
+# define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */
# endif
# define bcopy(s, d, l) (memmove((d), (s), (l)))
# define bzero(d, l) (memset((d), '\0', (l)))
# endif
# define bcopy(s, d, l) (memmove((d), (s), (l)))
# define bzero(d, l) (memset((d), '\0', (l)))