Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!hao!ames!ptsfa!ihnp4!cbosgd!cwruecmp!hal!ncoast!tdi2!brandon From: brandon@tdi2.UUCP (Brandon Allbery) Newsgroups: comp.unix.wizards Subject: Re: System V job control idea Message-ID: <359@tdi2.UUCP> Date: Sun, 24-May-87 23:30:56 EDT Article-I.D.: tdi2.359 Posted: Sun May 24 23:30:56 1987 Date-Received: Tue, 26-May-87 02:12:11 EDT References: <337@tdi2.UUCP> <757@mcgill-vision.UUCP> <165@elan.UUCP> Reply-To: brandon@tdi2.UUCP (Brandon Allbery) Followup-To: comp.unix.wizards Organization: Tridelta Industries, Inc., Mentor, Ohio Lines: 49 I see the Great Net Timewarp has recycled a message of mine. (sigh.) Quoted from <165@elan.UUCP> ["Re: System V job control idea"], by jlo@elan.UUCP (Jeff Lo)... +--------------- | In article <757@mcgill-vision.UUCP>, mouse@mcgill-vision.UUCP (der Mouse) writes: | > In article <337@tdi2.UUCP>, brandon@tdi2.UUCP (Brandon Allbery) writes: | > > Recently it occurred to me that there exists a form of simple job | > > control under every version of UNIX since the Seventh Edition (at | > > least). It's called ptrace(). | > | > A very interesting notion. Probably worth at least following up | > somewhat. | | tell you this is happening, my guess is it will fight with the other | processes reading from the terminal for input. The one way I have thought of | to get around this is to use ptrace() again. Set a breakpoint at _read and | check the stack for file descriptor 0. You will also have to parse the | command line to see if stdin was redirected from somewhere else, and you | still won't know if fd 0 was closed and then reopened to something other than | the terminal. And this much works only if there is a symbol table in the | binary to find the address of _read from. Things like select() may also get | confused. Using ptrace() in this way may also slow down execution a lot. | There is no penalty to just run and intercept signals, but breakpoints may | slow it down considerably. +--------------- (1) I was informed in no uncertain terms that using ptrace() at all imposed an execution penalty. (I should take it with a grain of salt, as I was also told in no uncertain terms that all signal handling would be screwed up; but I did read the manual on ptrace(), and it can be made to handle all signals very easily. (2) Your read trick is, to say the least, a kludge. Unfortunately, short of SIGTTIN there is no fix. (3) No select(). Poll(), maybe, iff sVr3 (we're sVr2). I have decided to skip sV job control in favor of pushing harder on a certain computer company to get off its *ss and implement sxt's. Also I am planning to add sxts to Minix, and may add some form of job control IF I can work out a clean way of doing it. (If that certain computer company chooses not to respond, we may end up doing business with their net-neighbor instead....) ++Brando -- Brandon S. Allbery UUCP: cbatt!cwruecmp!ncoast!tdi2!brandon Tridelta Industries, Inc. CSNET: ncoast!allbery@Case 7350 Corporate Blvd. INTERNET: ncoast!allbery%Case.CSNET@relay.CS.NET Mentor, Ohio 44060 PHONE: +1 216 255 1080 (home +1 216 974 9210)