mem: print mincore output as an array

* mem.c (SYS_FUNC(minore)): Print commas between elements.
* tests/mincore.c (print_mincore): Update expected output in accordance
with syscall decoder formatting change.
This commit is contained in:
Eugene Syromyatnikov 2016-11-28 04:28:53 +03:00 committed by Dmitry V. Levin
parent a938b441d6
commit d4d5aaa560
2 changed files with 4 additions and 0 deletions

2
mem.c
View File

@ -287,6 +287,8 @@ SYS_FUNC(mincore)
unsigned long i;
tprints("[");
for (i = 0; i < len; i++) {
if (i)
tprints(", ");
if (abbrev(tcp) && i >= max_strlen) {
tprints("...");
break;

View File

@ -42,6 +42,8 @@ print_mincore(const unsigned int pages, void *const addr,
printf("mincore(%p, %zu, [", addr, size);
for (i = 0; i < pages; ++i) {
if (i)
printf(", ");
if (i >= DEFAULT_STRLEN) {
printf("...");
break;