Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site rlvd.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!mcvax!ukc!qtlon!flame!ubu!rlvd!jimmy From: jimmy@rlvd.UUCP (Jimmy Aitken) Newsgroups: net.lang.c,net.unix Subject: Test for background process Message-ID: <233@rlvd.UUCP> Date: Mon, 14-Jan-85 04:59:16 EST Article-I.D.: rlvd.233 Posted: Mon Jan 14 04:59:16 1985 Date-Received: Fri, 18-Jan-85 03:23:56 EST Reply-To: jimmy@rlvd.UUCP (Jimmy Aitken) Organization: Atlas Lab, SERC, UK (+44 235 21900) Lines: 11 Xref: watmath net.lang.c:3915 net.unix:3344 I am trying to detect uniquely when one of the following situations occurs in a C program. I have tried isatty(3) but cannot distinguish between a), b), and c) below. Any helpful pointers would be appreciated. a) The standard input has been re-directed in a foreground process b) The standard input has been re-directed in a background process c) No re-direction of standard input in a background process d) No re-direction of standard input in a foreground process