problems with winopen()

Thant Tessman thant at horus.sgi.com
Wed May 31 00:42:31 AEST 1989


In article <890527165733.2080ecc2 at SIC.Epfl.CH>, dieperink%uliis.unil.ch at 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 at ULIIS.UNIL.CH
>          DIEPERINK at ELMA.EPFL.CH
>          ADIEPERI at 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 at sgi.com



More information about the Comp.sys.sgi mailing list