Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!ames!sgi!thant@horus.sgi.com From: thant@horus.sgi.com (Thant Tessman) Newsgroups: comp.sys.sgi Subject: Re: problems with winopen() Summary: use the foreground command Message-ID: <33892@sgi.SGI.COM> Date: 30 May 89 14:42:31 GMT References: <890527165733.2080ecc2@SIC.Epfl.CH> Sender: daemon@sgi.SGI.COM Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 40 In article <890527165733.2080ecc2@SIC.Epfl.CH>, dieperink%uliis.unil.ch@CUNYVM.CUNY.EDU ("Alwin Dieperink, Assistant-Etudiant") writes: > Hi, > >I have the following problem : > >In the program here under, i want to open a window, and then continue to read >data from the keyboard. The data should be echoed in the shell window. > (i want > to give the program commands to do some drawing in the window i opened). > > When i run the program, the window opens normally, > and the text "t1" appears in > the shell window. But the shell prompt already got back, and i can't anymore > give data to my program. > > When i do a ps from another window, i see that the process still lives. >It dies > when i type two commands in my shell. I also noticed, that the PID is not > the same before and after the winopen. The PPID also changed. > It was the shells > PID before winopen, and 1 after. > > Does anyone have an idea ?? Why does winopen() create a new process ? > How can I > solve that problem ? or did I miss something in the manuals ? > > Thanks. > > -- Alwin Dieperink > > E-Mail : DIEPERINK@ULIIS.UNIL.CH > DIEPERINK@ELMA.EPFL.CH > ADIEPERI@CLSUNI51.BITNET > The winopen forks off a process just so the program won't steal the shell. To keep winopen from forking the process, precede it with a call to 'foreground()'. thant@sgi.com