summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-04-15 18:16:37 -0400
committerRich Felker <dalias@aerifal.cx>2014-04-15 18:16:37 -0400
commitde20a8ffc5cf89134f035193ce1cdc2d76c88ee0 (patch)
tree2909fd33adee75e03788e11ac1c51a8efb562526 /arch
parent6cf7d17f5349df9ee4a2d8c8c7c5d01c18385e08 (diff)
downloadmusl-de20a8ffc5cf89134f035193ce1cdc2d76c88ee0.tar.gz
musl-de20a8ffc5cf89134f035193ce1cdc2d76c88ee0.tar.bz2
musl-de20a8ffc5cf89134f035193ce1cdc2d76c88ee0.tar.xz
musl-de20a8ffc5cf89134f035193ce1cdc2d76c88ee0.zip
add namespace-protected name for sysinfo function
it will be needed to implement some things in sysconf, and the syscall can't easily be used directly because the x32 syscall uses the wrong structure layout. the l (uncreative, for "linux") prefix is used since the symbol name __sysinfo is already taken for AT_SYSINFO from the aux vector. the way the x32 override of this function works is also changed to be simpler and avoid the useless jump instruction.
Diffstat (limited to 'arch')
-rw-r--r--arch/x32/src/sysinfo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x32/src/sysinfo.c b/arch/x32/src/sysinfo.c
index 0f11cf3c..d1c1b148 100644
--- a/arch/x32/src/sysinfo.c
+++ b/arch/x32/src/sysinfo.c
@@ -1,5 +1,6 @@
#include <sys/sysinfo.h>
#include "syscall.h"
+#include "libc.h"
#define klong long long
#define kulong unsigned long long
@@ -20,7 +21,7 @@ struct kernel_sysinfo {
unsigned mem_unit;
};
-int __x32_sysinfo(struct sysinfo *info)
+int __lsysinfo(struct sysinfo *info)
{
struct kernel_sysinfo tmp;
int ret = syscall(SYS_sysinfo, &tmp);
@@ -45,3 +46,5 @@ int __x32_sysinfo(struct sysinfo *info)
info->mem_unit = (tmp.mem_unit ? tmp.mem_unit : 1) << shifts;
return ret;
}
+
+weak_alias(__lsysinfo, sysinfo);