Qshell Interpreter (qsh) - FTP Directory Listing - IBM
Qshell Interpreter (qsh) - FTP Directory Listing - IBM
Qshell Interpreter (qsh) - FTP Directory Listing - IBM
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
*/<br />
void<br />
MySignalHandler(int signo)<br />
{<br />
switch (signo) {<br />
case SIGINT:<br />
printf(“\n<strong>qsh</strong>c: c ends this program\n”);<br />
printf(“Ended <strong>qsh</strong> session on %s\n”, sysname);<br />
exit(0);<br />
break;<br />
default:<br />
exit(1);<br />
break;<br />
} /* End of switch */<br />
return;<br />
} /* End of MySignalHandler() */<br />
/*<br />
* Display usage message.<br />
*/<br />
void usage(void)<br />
{<br />
fprintf(stderr, “Usage: <strong>qsh</strong>c [-n] [-p port] hostname\n”);<br />
exit(1);<br />
} /* End of usage() */<br />
[ Legal | AS/400 Glossary ]<br />
Creating and running the server program<br />
Creating the server program<br />
The following example shows how to create the server program on AS/400. The<br />
example assumes that the source for the server program is in member SERVER in<br />
the file QGPL/QCSRC. The server program is owned by a special user profile<br />
QSHSVR that has minimal authorities but private authority to the QSYGETPH(),<br />
QSYRLSPH(), and QWTSETP() APIs. It is not possible to sign on using the<br />
QSHSVR user profile. The server program adopts the authority of QSHSVR so it<br />
can switch to the client’s user profile.<br />
CRTBNDC PGM(QGPL/SERVER)<br />
SRCFILE(QGPL/QCSRC)<br />
SRCMBR(SERVER)<br />
OPTIMIZE(40)<br />
SYSIFCOPT(*IFSIO)<br />
LOCALETYPE(*LOCALE)<br />
USRPRF(*OWNER)<br />
AUT(*USE)<br />
TEXT('Shell server')<br />
CRTUSRPRF USRPRF(QSHSVR)<br />
PASSWORD(*NONE)<br />
USRCLS(*USER)<br />
TEXT('Shell server profile')<br />
CHGOBJOWN OBJ(QGPL/SERVER)<br />
OBJTYPE(*PGM)<br />
NEWOWN(QSHSVR)<br />
GRTOBJAUT OBJ(QSYS/QSYGETPH)<br />
OBJTYPE(*PGM)<br />
USER(QSHSVR)<br />
AUT(*USE)<br />
GRTOBJAUT OBJ(QSYS/QSYRLSPH)<br />
OBJTYPE(*PGM)<br />
Chapter 6. Remote client examples 133