mirror of
https://github.com/GnoConsortium/gno.git
synced 2025-02-28 02:29:03 +00:00
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.
This commit is contained in:
parent
e72e1c891f
commit
2553a92197
33
usr.bin/launch/launch.c
Normal file
33
usr.bin/launch/launch.c
Normal file
@ -0,0 +1,33 @@
|
||||
#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 */
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user