sysconf(3) returns long.
On LP32, this makes no difference. Not an ABI change.
On LP64, results are going to be in %rax or x0 whether they're 32- or 64-bit,
and the only difference is going to be whether the top bits are clobbered.
(cherry picked from commit 60d84af1726225320b26683b726e5e735d9d76e8)
Bug: 18390956
Change-Id: I722461498bc5494e2972fb07d5189dffe76e8993
diff --git a/libc/bionic/sysconf.cpp b/libc/bionic/sysconf.cpp
index 8309f08..7734e40 100644
--- a/libc/bionic/sysconf.cpp
+++ b/libc/bionic/sysconf.cpp
@@ -150,7 +150,7 @@
return (rc == -1) ? -1 : _POSIX_VERSION;
}
-int sysconf(int name) {
+long sysconf(int name) {
switch (name) {
#ifdef _POSIX_ARG_MAX
case _SC_ARG_MAX: return _POSIX_ARG_MAX;
diff --git a/libc/include/sys/sysconf.h b/libc/include/sys/sysconf.h
index 0a46e7a..3d058d7 100644
--- a/libc/include/sys/sysconf.h
+++ b/libc/include/sys/sysconf.h
@@ -129,7 +129,7 @@
#define _SC_AVPHYS_PAGES 0x0063
#define _SC_MONOTONIC_CLOCK 0x0064
-extern int sysconf(int name);
+long sysconf(int);
__END_DECLS
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index 9b9adce..1bfdb0e 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -177,7 +177,7 @@
int getpagesize(void);
-extern int sysconf(int name);
+long sysconf(int);
extern int daemon(int, int);