about summary refs log tree commit diff
path: root/sysdeps/mach
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-10-01 15:57:00 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-10-01 15:57:21 -0700
commitb5648377d923d790dd7e995d79d480066b25e6bb (patch)
tree68a01fd0c6ee4ecf44f4a252f8385e410134311f /sysdeps/mach
parent0389a6aaae6d07f69de5b42345293ec578337de2 (diff)
downloadglibc-b5648377d923d790dd7e995d79d480066b25e6bb.tar.gz
glibc-b5648377d923d790dd7e995d79d480066b25e6bb.tar.xz
glibc-b5648377d923d790dd7e995d79d480066b25e6bb.zip
Hide internal sysinfo functions [BZ #18822]
Hide internal sysinfo functions to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/sys/sysinfo.h (__get_nprocs_conf): Add
	libc_hidden_proto.
	(__get_nprocs): Likewise.
	(__get_phys_pages): Likewise.
	(__get_avphys_pages): Likewise.
	(__get_child_max): Add attribute_hidden.
	* misc/getsysstats.c (__get_nprocs_conf): Add libc_hidden_def.
	(__get_nprocs): Likewise.
	(__get_phys_pages): Likewise.
	(__get_avphys_pages): Likewise.
	* sysdeps/mach/getsysstats.c (__get_nprocs_conf): Add
	libc_hidden_def.
	(__get_nprocs): Likewise.
	(__get_phys_pages): Likewise.
	(__get_avphys_pages): Likewise.
	* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Add
	libc_hidden_def.
	(__get_nprocs_conf): Likewise.
	(__get_phys_pages): Likewise.
	(__get_avphys_pages): Likewise.
Diffstat (limited to 'sysdeps/mach')
-rw-r--r--sysdeps/mach/getsysstats.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/mach/getsysstats.c b/sysdeps/mach/getsysstats.c
index 0dacab0300..3aabd61382 100644
--- a/sysdeps/mach/getsysstats.c
+++ b/sysdeps/mach/getsysstats.c
@@ -39,6 +39,7 @@ __get_nprocs_conf (void)
 
   return hbi.max_cpus;
 }
+libc_hidden_def (__get_nprocs_conf)
 weak_alias (__get_nprocs_conf, get_nprocs_conf)
 
 /* Return the number of processors currently available on the system. */
@@ -58,6 +59,7 @@ __get_nprocs (void)
 
   return hbi.avail_cpus;
 }
+libc_hidden_def (__get_nprocs)
 weak_alias (__get_nprocs, get_nprocs)
 
 /* Return the number of physical pages on the system. */
@@ -77,6 +79,7 @@ __get_phys_pages (void)
 
   return hbi.memory_size / __vm_page_size;
 }
+libc_hidden_def (__get_phys_pages)
 weak_alias (__get_phys_pages, get_phys_pages)
 
 /* Return the number of available physical pages */
@@ -102,4 +105,5 @@ __get_avphys_pages (void)
 
   return vs.free_count;
 }
+libc_hidden_def (__get_avphys_pages)
 weak_alias (__get_avphys_pages, get_avphys_pages)