#include #include #include int main(void) { int fd; FILE *fh; int c; if ((fd = open("/tmp/ecl-unix.lisp", O_RDONLY, 07777)) == -1) perror("open()"); if ((fh = fdopen(fd, "rw")) == NULL) perror("fdopen()"); while ((c = fgetc(fh)) != -1) fputc(c, stdout); fflush(stdout); if (fclose(fh) == EOF) perror("fclose()"); if (close(fd) == -1) perror("close()"); return 0; }