1
/*___INFO__MARK_BEGIN__*/
2
/*************************************************************************
4
* The Contents of this file are made available subject to the terms of
5
* the Sun Industry Standards Source License Version 1.2
7
* Sun Microsystems Inc., March, 2001
10
* Sun Industry Standards Source License Version 1.2
11
* =================================================
12
* The contents of this file are subject to the Sun Industry Standards
13
* Source License Version 1.2 (the "License"); You may not use this file
14
* except in compliance with the License. You may obtain a copy of the
15
* License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
17
* Software provided under this License is provided on an "AS IS" basis,
18
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
19
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
20
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
21
* See the License for the specific provisions governing your rights and
22
* obligations concerning the Software.
24
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
26
* Copyright: 2001 by Sun Microsystems, Inc.
28
* All Rights Reserved.
30
************************************************************************/
31
/*___INFO__MARK_END__*/
38
#include <Xm/MenuShell.h>
39
#include <Xm/RowColumn.h>
43
#include <Xmt/WorkingBox.h>
45
#include "qmon_rmon.h"
46
#include "qmon_start.h"
47
#include "qmon_browser.h"
52
/*-------------------------------------------------------------------------*/
53
static void get_pipe_input(XtPointer cld, int *fid, XtInputId *id);
54
static pid_t qmonForkProcess(XtAppContext app, Widget parent);
56
/*-------------------------------------------------------------------------*/
57
static void get_pipe_input(
65
if ((nbytes=read(*fid,buf,BUFSIZ)) == -1)
66
perror("get_pipe_input");
68
fprintf(stderr, "Parent: %s", buf);
71
static pid_t qmonForkProcess(
79
DENTER(GUI_LAYER, "qmonForkProcess");
81
if ( pipe(pfd1) < 0 ) {
82
fprintf(stderr, "pipe() failed\n");
86
if ((pid = fork()) == -1) {
87
fprintf(stderr, "fork() failed\n");
90
if (pid == 0) { /* child */
95
if (! (count++ % 1000000) )
96
write(1, "Hello, I'm the child\n",
97
strlen("Hello, I'm the child\n")+1);
102
XtAppAddInput(app,pfd1[0],(XtPointer)XtInputReadMask,
103
get_pipe_input, NULL);
113
/***************************************************************************/
114
Widget qmonStartupWindow(
117
Widget StartupShell, StartupRC, StartupLabel;
120
DENTER(TOP_LAYER, "qmonStartupWindow");
124
fprintf(stderr, "Parent pid = %d\n",
125
qmonForkProcess(XtWidgetToApplicationContext(parent), parent) );
128
StartupShell = XtVaCreateWidget("StartupShell",
129
topLevelShellWidgetClass,
134
StartupDialog = XtVaCreateManagedWidget("StartupDialog",
135
xmtWorkingBoxWidgetClass,
137
XmtNmessage, "WELCOME TO SGE",
138
XmtNshowScale, False,
139
XmtNshowButton, False,
144
x = (DisplayWidth(XtDisplay(parent), DefaultScreen(XtDisplay(parent)))
146
y = (DisplayHeight(XtDisplay(parent), DefaultScreen(XtDisplay(parent)))
148
StartupShell = XtVaCreateWidget( "StartupShell",
149
xmMenuShellWidgetClass,
156
StartupRC = XtVaCreateManagedWidget( "StartupRC",
157
xmRowColumnWidgetClass,
164
StartupLabel = XtVaCreateManagedWidget( "StartupLabel",
167
XmNalignment, XmALIGNMENT_CENTER,
170
XmNshadowThickness, 1,
172
XtRealizeWidget(StartupShell);
173
XtPopup(StartupShell, XtGrabNone);
174
XmtWaitUntilMapped(StartupShell);