diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2021-03-25 09:30:07 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2021-05-07 13:54:09 -0300 |
commit | 903bc7dcc2acafc40be11639767e10a2de712649 (patch) | |
tree | cee8ab271ec58e80ce0b34e33ad2c3f5f1662370 /sysdeps/unix/sysv/linux/m68k | |
parent | db373e4c57159ac82df4b07b596dd29c4cfe9d86 (diff) | |
download | glibc-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/m68k')
-rw-r--r-- | sysdeps/unix/sysv/linux/m68k/getsysstats.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/sysdeps/unix/sysv/linux/m68k/getsysstats.c b/sysdeps/unix/sysv/linux/m68k/getsysstats.c deleted file mode 100644 index 6915f6d721..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/getsysstats.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Determine various system internal values, Linux/m68k version. - Copyright (C) 2003-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@suse.de> - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <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 \ - { \ - (RESULT) = 0; \ - /* Read all lines and count the lines starting with the string \ - "CPU:". We don't have to fear extremely long lines since \ - the kernel will not generate them. 8192 bytes are really \ - enough. */ \ - char *l; \ - while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL) \ - if (strncmp (l, "CPU:", 4) == 0) \ - ++(RESULT); \ - } \ - while (0) - -#include <sysdeps/unix/sysv/linux/getsysstats.c> |