1
0
mirror of https://sourceware.org/git/glibc.git synced 2026-10-24 01:33:52 +03:00

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.
This commit is contained in:
H.J. Lu
2017-10-01 15:57:00 -07:00
parent 0389a6aaae
commit b5648377d9
5 changed files with 41 additions and 1 deletions

View File

@@ -226,6 +226,7 @@ __get_nprocs (void)
return result;
}
libc_hidden_def (__get_nprocs)
weak_alias (__get_nprocs, get_nprocs)
@@ -279,6 +280,7 @@ __get_nprocs_conf (void)
return result;
}
libc_hidden_def (__get_nprocs_conf)
weak_alias (__get_nprocs_conf, get_nprocs_conf)
@@ -320,6 +322,7 @@ __get_phys_pages (void)
__sysinfo (&info);
return sysinfo_mempages (info.totalram, info.mem_unit);
}
libc_hidden_def (__get_phys_pages)
weak_alias (__get_phys_pages, get_phys_pages)
long int
@@ -330,4 +333,5 @@ __get_avphys_pages (void)
__sysinfo (&info);
return sysinfo_mempages (info.freeram, info.mem_unit);
}
libc_hidden_def (__get_avphys_pages)
weak_alias (__get_avphys_pages, get_avphys_pages)