problem using sunview window + reading tty from a child process

Mark D. Baushke mdb at silvlis.com
Thu Feb 23 23:44:20 AEST 1989


Please note that due to an apparent time warp of some kind, my original
question was published after its solution was published.

The original question was in

        Sun-Spots Digest: Volume 7, Issue 153, message 2 of 16

the solution was published in

        Sun-Spots Digest: Volume 7, Issue 144, message 5 of 9

If possible, please either delete sunviewhelp.shar or include the solution
in that file.

[[ I wonder how that happened.  Sorry for the confusion.  I have removed
the shar file.  --wnl ]]

Problem/solution summary:

        Using stdin before creating a window and then again after the
        window no longer existed from a child process was not working.

        The problem is that sunview programs change process groups in
        the first call to window_create().  The work around should be
        something like this:

                int saved_pgrp;
                saved_pgrp = getpgrp(getpid());

                frame = window_create (NULL,FRAME,0);

                setpgrp(getpid(), saved_pgrp);


Thank you for anyone who may have obtained the shar file to try and help
me out.

Mark D. Baushke                 Internet:    mdb%silvlis.com at sun.com
Silvar-Lisco, Inc.              Nameservers: mdb at silvlis.com
1080 Marsh Road                 Usenet:      {pyramid,sgi,sun}!silvlis!mdb
Menlo Park, CA 94025-1053       Telephone:   +1 415 853-6411 / +1 415 969-8328

---------- Forwarded message From: sun!hvr (Heather Rose)

Mark,

The problem you're running into is that sunview programs change process
groups in the first call to window_create().  You can work around this
with something like this:

        int saved_pgrp;
        saved_pgrp = getpgrp(getpid());

        frame = window_create (NULL,FRAME,0);

        setpgrp(getpid(), saved_pgrp);

For just your first call to window_create().  Please try this and if it
does not work out for you, please get back to me by 1/31/89....

Also, if you use vfork instead you can save on some temporary swap space.
See the man page on fork.

Regards,

Heather Rose
U.S. Answer Center



More information about the Comp.sys.sun mailing list