2 * Simple child to iterate over the entire fd list, opening/reading/closing as we go.
13 #include "arch.h" // page_size
18 #include "trinity.h" // __unused__
20 int child_read_all_files(__unused__
int childno
)
27 for (i
= 0; i
< files_in_index
; i
++) {
31 filename
= fileindex
[i
];
33 ret
= (lstat(filename
, &sb
));
38 sb
.st_size
= page_size
;
40 buffer
= malloc(sb
.st_size
);
44 memset(buffer
, 0, sb
.st_size
);
46 fd
= open(filename
, O_RDONLY
| O_NONBLOCK
);
52 ret
= read(fd
, buffer
, sb
.st_size
);
54 // output(0, "%s:%s\n", filename, buffer);