1b3e94a20d
From release 0.1.0 pre-patched archive. This includes all Red Bear modifications previously maintained as patches in local/patches/relibc/.
20 lines
396 B
C
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);
|
|
}
|