/* buffers.c - experiment in multiple user space buffers to terminal 
 */

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

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;	
}

