changeset 38878:2082ea15b4e9

fsusage: remove SVR2 support SVR2 was obsolete by 1986 and is no longer supported by anybody, and its code was getting in the way of use of this module by Emacs, which has its own ‘read’ function anyway. * lib/fsusage.c: Do not include sys/filsys.h. (get_fs_usage): Remove SVR2-specific code. * m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Do not test for sys/filsys.h or set STAT_READ_FILSYS. * modules/fsusage (Depends-on): Do not depend on full-read.
author Paul Eggert <eggert@cs.ucla.edu>
date Sun, 01 Oct 2017 20:35:53 -0700
parents 2aa7c1e2a1e4
children ccf11c06b039
files ChangeLog lib/fsusage.c m4/fsusage.m4 modules/fsusage
diffstat 4 files changed, 12 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Oct 01 18:11:44 2017 -0700
+++ b/ChangeLog	Sun Oct 01 20:35:53 2017 -0700
@@ -1,5 +1,15 @@
 2017-10-01  Paul Eggert  <eggert@cs.ucla.edu>
 
+	fsusage: remove SVR2 support
+	SVR2 was obsolete by 1986 and is no longer supported by anybody,
+	and its code was getting in the way of use of this module by
+	Emacs, which has its own ‘read’ function anyway.
+	* lib/fsusage.c: Do not include sys/filsys.h.
+	(get_fs_usage): Remove SVR2-specific code.
+	* m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE):
+	Do not test for sys/filsys.h or set STAT_READ_FILSYS.
+	* modules/fsusage (Depends-on): Do not depend on full-read.
+
 	Simplify autoupdate of licenses
 	* config/srclistvars.sh (GNUWWWLICENSES): Move to a more-typical
 	place.
--- a/lib/fsusage.c	Sun Oct 01 18:11:44 2017 -0700
+++ b/lib/fsusage.c	Sun Oct 01 20:35:53 2017 -0700
@@ -43,9 +43,6 @@
 # if HAVE_SYS_FS_S5PARAM_H      /* Fujitsu UXP/V */
 #  include <sys/fs/s5param.h>
 # endif
-# if defined HAVE_SYS_FILSYS_H && !defined _CRAY
-#  include <sys/filsys.h>       /* SVR2 */
-# endif
 # if HAVE_SYS_STATFS_H
 #  include <sys/statfs.h>
 # endif
@@ -170,41 +167,6 @@
   fsp->fsu_files = PROPAGATE_ALL_ONES (fsd.fd_req.gtot);
   fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.fd_req.gfree);
 
-#elif defined STAT_READ_FILSYS          /* SVR2 */
-# ifndef SUPERBOFF
-#  define SUPERBOFF (SUPERB * 512)
-# endif
-
-  struct filsys fsd;
-  int fd;
-
-  if (! disk)
-    {
-      errno = 0;
-      return -1;
-    }
-
-  fd = open (disk, O_RDONLY);
-  if (fd < 0)
-    return -1;
-  lseek (fd, (off_t) SUPERBOFF, 0);
-  if (full_read (fd, (char *) &fsd, sizeof fsd) != sizeof fsd)
-    {
-      close (fd);
-      return -1;
-    }
-  close (fd);
-
-  fsp->fsu_blocksize = (fsd.s_type == Fs2b ? 1024 : 512);
-  fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.s_fsize);
-  fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.s_tfree);
-  fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.s_tfree);
-  fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.s_tfree) != 0;
-  fsp->fsu_files = (fsd.s_isize == -1
-                    ? UINTMAX_MAX
-                    : (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1));
-  fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.s_tinode);
-
 #elif defined STAT_STATFS3_OSF1         /* OSF/1 */
 
   struct statfs fsd;
--- a/m4/fsusage.m4	Sun Oct 01 18:11:44 2017 -0700
+++ b/m4/fsusage.m4	Sun Oct 01 20:35:53 2017 -0700
@@ -1,4 +1,4 @@
-# serial 31
+# serial 32
 # Obtaining file system usage information.
 
 # Copyright (C) 1997-1998, 2000-2001, 2003-2017 Free Software Foundation, Inc.
@@ -295,17 +295,6 @@
   fi
 fi
 
-if test $ac_fsusage_space = no; then
-  # SVR2
-  # (AIX, HP-UX, OSF/1 already handled above.)
-  AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/filsys.h>
-        ]])],
-    [AC_DEFINE([STAT_READ_FILSYS], [1],
-      [Define if there is no specific function for reading file systems usage
-       information and you have the <sys/filsys.h> header file.  (SVR2)])
-     ac_fsusage_space=yes])
-fi
-
 AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
 
 ])
@@ -342,6 +331,6 @@
 # Prerequisites of lib/fsusage.c not done by gl_FILE_SYSTEM_USAGE.
 AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA],
 [
-  AC_CHECK_HEADERS([dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h])
+  AC_CHECK_HEADERS([dustat.h sys/fs/s5param.h sys/statfs.h])
   gl_STATFS_TRUNCATES
 ])
--- a/modules/fsusage	Sun Oct 01 18:11:44 2017 -0700
+++ b/modules/fsusage	Sun Oct 01 20:35:53 2017 -0700
@@ -10,7 +10,6 @@
 largefile
 stdbool
 stdint
-full-read       [test $gl_cv_fs_space = yes]
 
 configure.ac:
 gl_FSUSAGE