]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
nproc: Remove support for IRIX.
authorBruno Haible <bruno@clisp.org>
Wed, 10 Sep 2025 21:12:33 +0000 (23:12 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 10 Sep 2025 21:12:51 +0000 (23:12 +0200)
* lib/nproc.c: Remove code for IRIX.
* m4/nproc.m4 (gl_PREREQ_NPROC): Don't test for <sys/sysmp.h> and sysmp.

ChangeLog
lib/nproc.c
m4/nproc.m4

index 84c85f42cf5bf52e442aa8e0e30648bece21fa60..7d5ab08d270c04388447e3ece673558be93c36a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2025-09-10  Bruno Haible  <bruno@clisp.org>
 
+       nproc: Remove support for IRIX.
+       * lib/nproc.c: Remove code for IRIX.
+       * m4/nproc.m4 (gl_PREREQ_NPROC): Don't test for <sys/sysmp.h> and sysmp.
+
        mprotect: Remove support for IRIX.
        * m4/mprotect.m4 (gl_FUNC_MPROTECT_WORKS): Remove cross-compilation
        guess for IRIX.
index f0b77ab381b394c1a47b476ce350a5862910a049..f63d19a6464765d8c6ca151d43e44b68dd04d97f 100644 (file)
 # include <sys/pstat.h>
 #endif
 
-#if HAVE_SYS_SYSMP_H
-# include <sys/sysmp.h>
-#endif
-
 #if HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
@@ -337,20 +333,6 @@ num_processors_available (enum nproc_query query)
   }
 #endif
 
-#if HAVE_SYSMP && defined MP_NAPROCS && defined MP_NPROCS
-  { /* This works on IRIX.  */
-    /* MP_NPROCS yields the number of installed processors.
-       MP_NAPROCS yields the number of processors available to unprivileged
-       processes.  */
-    int nprocs =
-      sysmp (query == NPROC_CURRENT && getuid () != 0
-             ? MP_NAPROCS
-             : MP_NPROCS);
-    if (nprocs > 0)
-      return nprocs;
-  }
-#endif
-
   /* Finally, as fallback, use the APIs that don't distinguish between
      NPROC_CURRENT and NPROC_ALL.  */
 
index 5e96afc93aa93e435c1f21e1fd7bbc1d3ca1d5ac..9225779585a817033cdf36f173fc6b4232ffb62c 100644 (file)
@@ -1,5 +1,5 @@
 # nproc.m4
-# serial 6
+# serial 7
 dnl Copyright (C) 2009-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@ AC_DEFUN([gl_PREREQ_NPROC],
   dnl Persuade glibc <sched.h> to declare CPU_SETSIZE, CPU_ISSET etc.
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
-  AC_CHECK_HEADERS([mntent.h sys/pstat.h sys/sysmp.h sys/param.h],,,
+  AC_CHECK_HEADERS([mntent.h sys/pstat.h sys/param.h],,,
     [AC_INCLUDES_DEFAULT])
   dnl <sys/sysctl.h> requires <sys/param.h> on OpenBSD 4.0.
   AC_CHECK_HEADERS([sys/sysctl.h],,,
@@ -27,7 +27,7 @@ AC_DEFUN([gl_PREREQ_NPROC],
      #endif
     ])
 
-  AC_CHECK_FUNCS([sched_getaffinity_np pstat_getdynamic sysmp sysctl])
+  AC_CHECK_FUNCS([sched_getaffinity_np pstat_getdynamic sysctl])
   gl_CHECK_FUNCS_ANDROID([sched_getaffinity], [[#include <sched.h>]])
 
   dnl Test whether sched_getaffinity has the expected declaration.