>From b0f00eeed03a65c361312cfc6a507c8be42971a9 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 16 Oct 2018 21:25:00 +0200 Subject: [PATCH 12/13] fsusage, mountlist, getloadavg, getgroups: Remove support for Ultrix. * m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Don't define STAT_STATFS2_FS_DATA. * lib/fsusage.c: Remove STAT_STATFS2_FS_DATA case. * m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Don't define MOUNTED_GETMNT. * lib/mountlist.c: Remove MOUNTED_GETMNT case. * lib/getloadavg.c (decstation): Remove definition and case. * m4/getgroups.m4 (AC_FUNC_GETGROUPS): Mention NeXTstep, not Ultrix. * lib/getgroups.c: Likewise. * doc/posix-functions/getgroups.texi: Likewise. * lib/time.in.h: Update comments. --- ChangeLog | 15 +++++++++++++++ doc/posix-functions/getgroups.texi | 2 +- lib/fsusage.c | 15 --------------- lib/getgroups.c | 4 ++-- lib/getloadavg.c | 15 +-------------- lib/mountlist.c | 34 ---------------------------------- lib/time.in.h | 2 +- m4/fsusage.m4 | 35 ----------------------------------- m4/getgroups.m4 | 4 ++-- m4/ls-mntd-fs.m4 | 18 ------------------ 10 files changed, 22 insertions(+), 122 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39164d9..5c8babf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,20 @@ 2018-10-16 Bruno Haible + fsusage, mountlist, getloadavg, getgroups: Remove support for Ultrix. + * m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Don't define + STAT_STATFS2_FS_DATA. + * lib/fsusage.c: Remove STAT_STATFS2_FS_DATA case. + * m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Don't define + MOUNTED_GETMNT. + * lib/mountlist.c: Remove MOUNTED_GETMNT case. + * lib/getloadavg.c (decstation): Remove definition and case. + * m4/getgroups.m4 (AC_FUNC_GETGROUPS): Mention NeXTstep, not Ultrix. + * lib/getgroups.c: Likewise. + * doc/posix-functions/getgroups.texi: Likewise. + * lib/time.in.h: Update comments. + +2018-10-16 Bruno Haible + getloadavg: Remove support for ConvexOS. * lib/getloadavg.c: Remove convex case. diff --git a/doc/posix-functions/getgroups.texi b/doc/posix-functions/getgroups.texi index e363227..221f894 100644 --- a/doc/posix-functions/getgroups.texi +++ b/doc/posix-functions/getgroups.texi @@ -16,7 +16,7 @@ On some platforms, this function fails to reject a negative count, even though that is less than the size that would be returned: FreeBSD 7.2. @item -On Ultrix 4.3, @code{getgroups (0, NULL)} always fails. See macro +On NeXTstep 3.2, @code{getgroups (0, NULL)} always fails. See macro @samp{AC_FUNC_GETGROUPS}. @item On very old systems, this function operated on an array of @samp{int}, diff --git a/lib/fsusage.c b/lib/fsusage.c index e33152a..17daf91 100644 --- a/lib/fsusage.c +++ b/lib/fsusage.c @@ -148,21 +148,6 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp) ? PROPAGATE_ALL_ONES (fsd.f_frsize) : PROPAGATE_ALL_ONES (fsd.f_bsize)); -#elif defined STAT_STATFS2_FS_DATA /* Ultrix */ - - struct fs_data fsd; - - if (statfs (file, &fsd) != 1) - return -1; - - fsp->fsu_blocksize = 1024; - fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.fd_req.btot); - fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.fd_req.bfree); - fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.fd_req.bfreen); - fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.fd_req.bfreen) != 0; - fsp->fsu_files = PROPAGATE_ALL_ONES (fsd.fd_req.gtot); - fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.fd_req.gfree); - #elif defined STAT_STATFS3_OSF1 /* OSF/1 */ struct statfs fsd; diff --git a/lib/getgroups.c b/lib/getgroups.c index ec137c1..cd6f4d7 100644 --- a/lib/getgroups.c +++ b/lib/getgroups.c @@ -58,8 +58,8 @@ int posix_getgroups (int, gid_t []) __asm ("_getgroups"); # define getgroups posix_getgroups # endif -/* On at least Ultrix 4.3 and NextStep 3.2, getgroups (0, NULL) always - fails. On other systems, it returns the number of supplemental +/* On at least NeXTstep 3.2, getgroups (0, NULL) always fails. + On other systems, it returns the number of supplemental groups for the process. This function handles that special case and lets the system-provided function handle all others. However, it can fail with ENOMEM if memory is tight. It is unspecified diff --git a/lib/getloadavg.c b/lib/getloadavg.c index a1ab342..4e7eb0d 100644 --- a/lib/getloadavg.c +++ b/lib/getloadavg.c @@ -97,11 +97,6 @@ # define WINDOWS32 # endif -# if !defined (BSD) && defined (ultrix) -/* Ultrix behaves like BSD on Vaxen. */ -# define BSD -# endif - # ifdef NeXT /* NeXT in the 2.{0,1,2} releases defines BSD in , which conflicts with the definition understood in this file, that this @@ -141,10 +136,6 @@ # define MORE_BSD # endif -# if defined (ultrix) && defined (mips) -# define decstation -# endif - # if defined (__SVR4) && !defined (SVR4) # define SVR4 # endif @@ -180,10 +171,6 @@ # define LOAD_AVE_TYPE long # endif -# ifdef decstation -# define LOAD_AVE_TYPE long -# endif - # ifdef sgi # define LOAD_AVE_TYPE long # endif @@ -218,7 +205,7 @@ # define FSCALE 2048.0 # endif -# if defined (MIPS) || defined (SVR4) || defined (decstation) +# if defined (MIPS) || defined (SVR4) # define FSCALE 256 # endif diff --git a/lib/mountlist.c b/lib/mountlist.c index 01ad309..9a94f42 100644 --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -84,11 +84,6 @@ # include #endif -#ifdef MOUNTED_GETMNT /* (obsolete) Ultrix */ -# include -# include -#endif - #ifdef MOUNTED_FS_STAT_DEV /* Haiku, also (obsolete) BeOS */ # include # include @@ -647,35 +642,6 @@ read_file_system_list (bool need_fs_type) } #endif /* MOUNTED_GETMNTINFO2 */ -#ifdef MOUNTED_GETMNT /* (obsolete) Ultrix */ - { - int offset = 0; - int val; - struct fs_data fsd; - - while (errno = 0, - 0 < (val = getmnt (&offset, &fsd, sizeof (fsd), NOSTAT_MANY, - (char *) 0))) - { - me = xmalloc (sizeof *me); - me->me_devname = xstrdup (fsd.fd_req.devname); - me->me_mountdir = xstrdup (fsd.fd_req.path); - me->me_mntroot = NULL; - me->me_type = gt_names[fsd.fd_req.fstype]; - me->me_type_malloced = 0; - me->me_dummy = ME_DUMMY (me->me_devname, me->me_type); - me->me_remote = ME_REMOTE (me->me_devname, me->me_type); - me->me_dev = fsd.fd_req.dev; - - /* Add to the linked list. */ - *mtail = me; - mtail = &me->me_next; - } - if (val < 0) - goto free_then_fail; - } -#endif /* MOUNTED_GETMNT. */ - #if defined MOUNTED_FS_STAT_DEV /* Haiku, also (obsolete) BeOS */ { /* The next_dev() and fs_stat_dev() system calls give the list of diff --git a/lib/time.in.h b/lib/time.in.h index 44ba9bc..feb1d6c 100644 --- a/lib/time.in.h +++ b/lib/time.in.h @@ -48,7 +48,7 @@ /* The definition of _GL_WARN_ON_USE is copied here. */ -/* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3). +/* Some systems don't define struct timespec (e.g., AIX 4.1). Or they define it with the wrong member names or define it in (e.g., FreeBSD circa 1997). Stock Mingw prior to 3.0 does not define it, but the pthreads-win32 library defines it in . */ diff --git a/m4/fsusage.m4 b/m4/fsusage.m4 index 96378ba..c3ba439 100644 --- a/m4/fsusage.m4 +++ b/m4/fsusage.m4 @@ -263,41 +263,6 @@ int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1]; fi fi - if test $ac_fsusage_space = no; then - # Ultrix - AC_CACHE_CHECK([for two-argument statfs with struct fs_data (Ultrix)], - [fu_cv_sys_stat_fs_data], - [AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#ifdef HAVE_SYS_MOUNT_H -#include -#endif -#ifdef HAVE_SYS_FS_TYPES_H -#include -#endif - int - main () - { - struct fs_data fsd; - /* Ultrix's statfs returns 1 for success, - 0 for not mounted, -1 for failure. */ - return statfs (".", &fsd) != 1; - }]])], - [fu_cv_sys_stat_fs_data=yes], - [fu_cv_sys_stat_fs_data=no], - [fu_cv_sys_stat_fs_data=no]) - ]) - if test $fu_cv_sys_stat_fs_data = yes; then - ac_fsusage_space=yes - AC_DEFINE([STAT_STATFS2_FS_DATA], [1], - [Define if statfs takes 2 args and the second argument has - type struct fs_data. (Ultrix)]) - fi - fi - AS_IF([test $ac_fsusage_space = yes], [$1], [$2]) ]) diff --git a/m4/getgroups.m4 b/m4/getgroups.m4 index d382402..8cddb6c 100644 --- a/m4/getgroups.m4 +++ b/m4/getgroups.m4 @@ -1,4 +1,4 @@ -# serial 20 +# serial 21 dnl From Jim Meyering. dnl A wrapper around AC_FUNC_GETGROUPS. @@ -34,7 +34,7 @@ AC_DEFUN([AC_FUNC_GETGROUPS], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT], - [[/* On Ultrix 4.3, getgroups (0, 0) always fails. */ + [[/* On NeXTstep 3.2, getgroups (0, 0) always fails. */ return getgroups (0, 0) == -1;]]) ], [ac_cv_func_getgroups_works=yes], diff --git a/m4/ls-mntd-fs.m4 b/m4/ls-mntd-fs.m4 index 64a2dfc..7a4efcc 100644 --- a/m4/ls-mntd-fs.m4 +++ b/m4/ls-mntd-fs.m4 @@ -311,24 +311,6 @@ int getmntinfo (struct statfs **, int); fi if test -z "$ac_list_mounted_fs"; then - # (obsolete) Ultrix. - AC_CACHE_CHECK([for getmnt function], - [fu_cv_sys_mounted_getmnt], - [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ -#include -#include ]])], - [fu_cv_sys_mounted_getmnt=yes], - [fu_cv_sys_mounted_getmnt=no]) - ]) - if test $fu_cv_sys_mounted_getmnt = yes; then - ac_list_mounted_fs=found - AC_DEFINE([MOUNTED_GETMNT], [1], - [Define if there is a function named getmnt for reading the list of - mounted file systems. (Ultrix)]) - fi - fi - - if test -z "$ac_list_mounted_fs"; then # Haiku, also (obsolete) BeOS. AC_CHECK_FUNCS([next_dev fs_stat_dev]) AC_CHECK_HEADERS([fs_info.h]) -- 2.7.4