CS476/576
Assignment #4
Due Midnight, Tuesday Nov
1, 1999
Implement the following program using Motif
and
UNIX functions.
NAME
XK - exec
& kill processes
SYNOPSIS
XK [time-out]
DESCRIPTION
The program creates a motif-based
interface with 3 push buttons as shown in the Figure
below.
-
EXEC:
when the user activates this button, it asks him/her to enter the command
to be executed (using a one-line input widget similar to driver.c
& inputfield.c).
The executed command displays its output in an xterm (similar to
xbuttons2.c).
-
KILL:
when the user activate this button, it displays a list of the currently
executing commands (in a widget similar to chooseone.c
). The program kills the the selected command and
waits for the terminated process (so the process will not become zombie).
-
QUIT:
When activated (by clicking on the button, typing CTRL-C or CTRL-\ on the
terminal where the XK program started), it asks for confirmation (similar
to askquestion.c
).
-
Time-out: If
the user did not interact with the XK program (by clicking on either EXEC
or KILL) for a period exceeding time-out (an optional
argument to XK, which defaults to 1 minute), the program displays the Quit
confirmation dialogue.
-
Termination: If
the user didn't respond to the Quit dialogue for a period exceeding time-out,
or he/she clicks on the OK button of the Quit dialogue, then the
XK program kills and waits for all its active children processes before
it exits.
Back
to Assignments Page
Back
to CS476/576 Home Page