gno/usr.bin/launch/launch.c
gdr-ftp 2553a92197 Initial checkin for launch(1). No changes yet for GNO v2.0.6.
The man page has been copied from the gno/usr.man/man1 directory,
from which it will be deleted.
1998-04-10 19:41:57 +00:00

34 lines
757 B
C

#include <stdio.h>
#include <gno/gno.h>
#include <gsos.h>
#include <sys/signal.h>
void usage(void)
{
fprintf(stderr,"usage: launch [-n] pathname\n");
fprintf(stderr," -n\tDo not return to GNO after launched program exits\n");
exit(1);
}
int main(int argc, char *argv[])
{
GSString255Ptr gs;
extern GSString255Ptr __C2GSMALLOC(char *);
unsigned int quitFlag;
int patharg = 1;
quitFlag = 0x8000;
if (argc == 3) {
if (strcmp("-n",argv[1])) usage();
else {
quitFlag = 0;
patharg = 2;
}
}
gs = __C2GSMALLOC(argv[patharg]);
SetGNOQuitRec(2,gs,quitFlag);
/* eventually will need to signal 'init' to shutdown the system;
for now, simply make the user ^D the shell */
}