Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!osu-cis!tut!lvc From: lvc@tut.UUCP Newsgroups: comp.lang.c,comp.unix.questions Subject: Why can't stdin from a file be read by an overlay? Message-ID: <2775@tut.cis.ohio-state.edu> Date: Thu, 3-Dec-87 19:35:36 EST Article-I.D.: tut.2775 Posted: Thu Dec 3 19:35:36 1987 Date-Received: Sun, 6-Dec-87 22:48:18 EST Organization: Ohio State Computer & Info Science Lines: 17 Keywords: Unix,stdio Xref: utgpu comp.lang.c:5409 comp.unix.questions:4640 I am using Unix System 5 Release 2 on an AT&T 3b5 and have seen the problem below many times and don't know what to do about it. Suppose a program reads stdin, prompts the user for some infor- mation, and then execs (no fork) a process to finish prompting the user for other information. There isn't a problem when the input is from a tty, however, if the input is redirected, say from a Bourne shell here document, the second process sees an EOF immediately. Any ideas on what might be wrong here and how to correct it? Does the shell use close-on-exec for stdin? Yes it design is insane but it has to be done this way. Thanks, -- Larry Cipriani AT&T Network Systems at cbosgd!osu-cis!tut!lvc Ohio State University