/* buffers.c - experiment in multiple user space buffers to terminal */ #include #include #include void moo(void *p) { FILE *fd = fdopen(1, "w"); if (fd == NULL) { perror("bad fdopen"); exit(0); } fprintf(fd, " and roses are red\n"); return; } int main() { printf("violets are blue"); /*this will be printed after what printed later by moo! */ moo(NULL); return 0; }