]> Savannah Git Hosting - gnulib.git/commitdiff
fsusage: remove SVR2 support
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 Oct 2017 03:35:53 +0000 (20:35 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 Oct 2017 03:36:35 +0000 (20:36 -0700)
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.

ChangeLog
lib/fsusage.c
m4/fsusage.m4
modules/fsusage

index 454a87733e148051f373631aa146f3b8b563ba1c..23d1b64a48988018ce869005a64a97535640e71f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 4513367f85311bbd4c088f6656b27f29e0d0315f..a0f763be05f72b6cde409a62a258e9c5315ef906 100644 (file)
@@ -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 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
   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;
index 526723ab6f316c225af109654b364c6b82d195bc..1d6ad41cd3c0ac3020959e4024fc8bdba29df1b2 100644 (file)
@@ -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 @@ if test $ac_fsusage_space = no; then
   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 @@ choke -- this is a workaround for a Sun-specific problem
 # 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
 ])
index b4475254604a80c0144664c433a770abe8dcf1e8..ba85196167fa2777660bf17381f1b769fb44e7ae 100644 (file)
@@ -10,7 +10,6 @@ Depends-on:
 largefile
 stdbool
 stdint
-full-read       [test $gl_cv_fs_space = yes]
 
 configure.ac:
 gl_FSUSAGE