about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/alpha
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-03-25 09:30:07 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-05-07 13:54:09 -0300
commit903bc7dcc2acafc40be11639767e10a2de712649 (patch)
treecee8ab271ec58e80ce0b34e33ad2c3f5f1662370 /sysdeps/unix/sysv/linux/alpha
parentdb373e4c57159ac82df4b07b596dd29c4cfe9d86 (diff)
downloadglibc-903bc7dcc2acafc40be11639767e10a2de712649.tar.gz
glibc-903bc7dcc2acafc40be11639767e10a2de712649.tar.xz
glibc-903bc7dcc2acafc40be11639767e10a2de712649.zip
linux: Use sched_getaffinity for __get_nprocs (BZ #27645)
Both the sysfs and procfs parsing (through GET_NPROCS_PARSER) are
removed in favor the syscall.  The initial scratch buffer should
fit to most of the common usage (1024 bytes with maps to 8192 CPUs).

Checked on x86_64-linux-gnu and aarch64-linux-gnu.
Diffstat (limited to 'sysdeps/unix/sysv/linux/alpha')
-rw-r--r--sysdeps/unix/sysv/linux/alpha/getsysstats.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/getsysstats.c b/sysdeps/unix/sysv/linux/alpha/getsysstats.c
index bdf794703a..098575faef 100644
--- a/sysdeps/unix/sysv/linux/alpha/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/alpha/getsysstats.c
@@ -18,25 +18,6 @@
    <https://www.gnu.org/licenses/>.  */
 
 
-/* We need to define a special parser for /proc/cpuinfo.  */
-#define GET_NPROCS_PARSER(FD, BUFFER, CP, RE, BUFFER_END, RESULT)	   \
-  do									   \
-    {									   \
-      /* Find the line that contains the information about the number of   \
-	 active cpus.  We don't have to fear extremely long lines since	   \
-	 the kernel will not generate them.  8192 bytes are really enough. \
-	 If there is no "CPUs ..." line then we are on a UP system.  */	   \
-      char *l;								   \
-      (RESULT) = 1;							   \
-      while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL)  \
-	if ((sscanf (BUFFER, "cpus active : %d", &(RESULT)) == 1)	   \
-	    || (sscanf (BUFFER, "CPUs probed %*d active %d",		   \
-			&(RESULT)) == 1))  				   \
-	  break;							   \
-    }									   \
-  while (0)
-
-
 /* On the Alpha we can distinguish between the number of configured and
    active cpus.  */
 #define GET_NPROCS_CONF_PARSER(FP, BUFFER, RESULT)			   \