Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site wgivax.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!whuxl!whuxlm!akgua!mcnc!unccvax!wgivax!mo From: mo@wgivax.UUCP (Michael O'Shea) Newsgroups: net.unix-wizards Subject: am I in background? Message-ID: <129@wgivax.UUCP> Date: Tue, 5-Nov-85 09:55:06 EST Article-I.D.: wgivax.129 Posted: Tue Nov 5 09:55:06 1985 Date-Received: Thu, 7-Nov-85 05:55:46 EST Lines: 18 On a 4.2 system, is there any reliable way in which a c-program can determine from within itself if it is running in background and/or has its input and/or output redirected (from/into a file or through a pipe)? I am aware of the method on Version 7 systems consisting of checking if the SIGINT signal is turned off initially, indicating a process started in back- ground. This does not work under 4.2. I am trying to implement an automatic audit trail mechanism which allows users to enter optional comments at the beginning of major system utilities (sort, awk, sed, etc.) The problem is that many of our users frequently use pipes, file redirection, and background processing, thus making the task of knowing when to query for a comment more complex. Thank you in advance. Mike O'Shea (decvax!mcnc!unccvax!wgivax!mo)