This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 0d3be3a1d996093aa2ecd41ef8ae7192760aa79c (commit)
via 199ffd4d10f8ef734032025e0a6847a9e2017bdd (commit)
via 5e3d8e668238f1ebbf96843ceb0a699d73a16a38 (commit)
via 766da4190705a32fbddd5d0fe61175d76ad31090 (commit)
via 14b15ceb1e98ff9a3cacd99bc1a77ce02e8c8684 (commit)
from e1eceda87b2fa64ab17f3e32c81b9a97edc7cac7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0d3be3a1d996093aa2ecd41ef8ae7192760aa79c
Author: Vlad Zakharov <Vladislav.Zakharov(a)synopsys.com>
Date: Thu Jun 16 18:29:09 2016 +0300
test: regex: Make testregex return error count
Testregex returned 0 even when some sub-tests
inside the testregex failed. Now it returns error
count.
Signed-off-by: Vlad Zakharov <vzakhar(a)synopsys.com>
commit 199ffd4d10f8ef734032025e0a6847a9e2017bdd
Author: Eugeniy Paltsev <Eugeniy.Paltsev(a)synopsys.com>
Date: Fri Jun 10 16:00:22 2016 +0300
Fix hardcoded mmap offset
mmap offset must be a multiple of the page size. It was hardcoded
to 4K, so mmap2 test failed on non-4K page size architectures.
Now we get page size using sysconf(_SC_PAGE_SIZE).
Build and run tests done on nsim arc hs38.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev(a)synopsys.com>
commit 5e3d8e668238f1ebbf96843ceb0a699d73a16a38
Author: Nicolas Cavallari <nicolas.cavallari(a)green-communications.fr>
Date: Tue Jun 14 15:12:18 2016 +0200
sysconf: Support _SC_(AV)?PHYS_PAGES.
Do it by following the trail of the existing commented code, which
implemented it by calling get_phys_pages() and get_avphys_pages().
This patch implements these two functions, which are also glibc
extensions.
Some program/libraries (e.g. libuv) assumes that sysconf(_SC_PHYS_PAGES)
works on linux and never check for -1, thus they report an insane amount
of memory.
Signed-off-by: Nicolas Cavallari <nicolas.cavallari(a)green-communications.fr>
commit 766da4190705a32fbddd5d0fe61175d76ad31090
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Wed Jun 15 20:42:29 2016 +0200
test: mmap2 is not ARM specific
commit 14b15ceb1e98ff9a3cacd99bc1a77ce02e8c8684
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Mon Jun 13 22:32:54 2016 +0200
add MAINTAINERS information
-----------------------------------------------------------------------
Summary of changes:
MAINTAINERS | 11 +++++++++++
include/sys/sysinfo.h | 2 --
libc/unistd/sysconf.c | 34 ++++++++++++++++++++++++++--------
test/mmap/Makefile.in | 4 ----
test/mmap/{mmap-arm.c => mmap2.c} | 2 +-
test/regex/testregex.c | 2 +-
6 files changed, 39 insertions(+), 16 deletions(-)
create mode 100644 MAINTAINERS
rename test/mmap/{mmap-arm.c => mmap2.c} (97%)
diff --git a/MAINTAINERS b/MAINTAINERS
new file mode 100644
index 0000000..cecfb24
--- /dev/null
+++ b/MAINTAINERS
@@ -0,0 +1,11 @@
+Maintainer: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
+
+Acrhitecture specific maintainers, Acked-By needed for any architecture
+specific changes:
+
+ARC:
+Alexey Brodkin <Alexey.Brodkin(a)synopsys.com>
+Vineet Gupta <Vineet.Gupta1(a)synopsys.com>
+
+Xtensa:
+Max Filippov <jcmvbkbc(a)gmail.com>
diff --git a/include/sys/sysinfo.h b/include/sys/sysinfo.h
index 00e3633..4e756e9 100644
--- a/include/sys/sysinfo.h
+++ b/include/sys/sysinfo.h
@@ -56,13 +56,11 @@ extern int sysinfo (struct sysinfo *__info) __THROW;
#define get_nprocs() (sysconf(_SC_NPROCESSORS_ONLN))
-#if 0
/* Return number of physical pages of memory in the system. */
extern long int get_phys_pages (void) __THROW;
/* Return number of available physical pages of memory in the system. */
extern long int get_avphys_pages (void) __THROW;
-#endif
__END_DECLS
diff --git a/libc/unistd/sysconf.c b/libc/unistd/sysconf.c
index 503b395..3d3b1a5 100644
--- a/libc/unistd/sysconf.c
+++ b/libc/unistd/sysconf.c
@@ -43,6 +43,32 @@
#include <dirent.h>
#include "internal/parse_config.h"
+long int get_phys_pages(void)
+{
+ struct sysinfo si;
+ int ps = getpagesize();;
+
+ sysinfo(&si);
+
+ if (ps >= si.mem_unit)
+ return si.totalram / (ps / si.mem_unit);
+ else
+ return si.totalram * (si.mem_unit / ps);
+}
+
+long int get_avphys_pages(void)
+{
+ struct sysinfo si;
+ int ps = getpagesize();;
+
+ sysinfo(&si);
+
+ if (ps >= si.mem_unit)
+ return si.freeram / (ps / si.mem_unit);
+ else
+ return si.freeram * (si.mem_unit / ps);
+}
+
static int nprocessors_onln(void)
{
char **l = NULL;
@@ -747,18 +773,10 @@ long int sysconf(int name)
RETURN_FUNCTION(nprocessors_onln());
case _SC_PHYS_PAGES:
-#if 0
RETURN_FUNCTION(get_phys_pages());
-#else
- RETURN_NEG_1;
-#endif
case _SC_AVPHYS_PAGES:
-#if 0
RETURN_FUNCTION(get_avphys_pages());
-#else
- RETURN_NEG_1;
-#endif
case _SC_ATEXIT_MAX:
return __UCLIBC_MAX_ATEXIT;
diff --git a/test/mmap/Makefile.in b/test/mmap/Makefile.in
index 7bb34ac..581f3b0 100644
--- a/test/mmap/Makefile.in
+++ b/test/mmap/Makefile.in
@@ -1,6 +1,2 @@
# uClibc mmap tests
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-
-ifneq ($(TARGET_ARCH),arm)
-TESTS_DISABLED += mmap-arm
-endif
diff --git a/test/mmap/mmap-arm.c b/test/mmap/mmap2.c
similarity index 97%
rename from test/mmap/mmap-arm.c
rename to test/mmap/mmap2.c
index 8b94c61..1d5f5db 100644
--- a/test/mmap/mmap-arm.c
+++ b/test/mmap/mmap2.c
@@ -18,7 +18,7 @@
#define FATAL do { fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", \
__LINE__, __FILE__, errno, strerror(errno)); exit(1); } while(0)
-#define MAP_SIZE 4096UL
+#define MAP_SIZE sysconf(_SC_PAGESIZE)
#define MAP_MASK (MAP_SIZE - 1)
int main(int argc, char **argv) {
diff --git a/test/regex/testregex.c b/test/regex/testregex.c
index 993ac26..d18761d 100644
--- a/test/regex/testregex.c
+++ b/test/regex/testregex.c
@@ -2115,7 +2115,7 @@ old_main(int unused_param_argc, char** argv)
if (fp != stdin)
fclose(fp);
}
- return 0;
+ return state.errors;
}
int main(int argc, char **argv)
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
Show replies by date