Files
Red Bear OS 1b3e94a20d Red Bear OS relibc baseline
From release 0.1.0 pre-patched archive.
This includes all Red Bear modifications previously maintained
as patches in local/patches/relibc/.
2026-06-27 09:19:26 +03:00

20 lines
396 B
C

#include <stdio.h>
#include <stdlib.h>
#include "test_helpers.h"
int main(void) {
FILE *fp = popen("ls -1 example_dir", "r");
ERROR_IF(popen, fp, == NULL);
int lineno = 0;
char path[256] = { 0 };
while (fgets(path, 256, fp) != NULL) {
lineno++;
printf("Line %d: %s", lineno, path);
}
int status = pclose(fp);
ERROR_IF(pclose, status, == -1);
}