Open Akuli opened 2 years ago
stdbuf
might be good for this
akuli@akuli-desktop:~$ cat foo.c
#include <stdio.h>
#include <sys/select.h>
int main(void)
{
printf("a\n");
struct timeval t = { .tv_sec = 1 };
select(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &t);
printf("b\n");
}
akuli@akuli-desktop:~$ gcc foo.c
akuli@akuli-desktop:~$ timeout 1 ./a.out | cat
Terminated
akuli@akuli-desktop:~$ timeout 1 stdbuf -o0 ./a.out | cat
a
Terminated
Try compiling and running this in porcupine. Doesn't print anything if you remove
fflush(stdout)