29.06.2013 Views

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 5. <strong>Qshell</strong> APIs<br />

The following APIs (application program interfaces) are available for <strong>Qshell</strong>:<br />

v QzshSystem() - Run a QSH Command<br />

v QzshCheckShellCommand() - Find QSH Command<br />

[ Legal | AS/400 Glossary ]<br />

QzshSystem() - Run a QSH Command<br />

Parameters<br />

Authorities<br />

Return Value<br />

Syntax<br />

#include <br />

int QzshSystem( const char *command );<br />

Threadsafe: Yes<br />

The QzshSystem() function runs the specified shell command by spawning a child<br />

process and invoking <strong>qsh</strong> in the child process. <strong>qsh</strong> interprets and runs command<br />

and then exits.<br />

The QzshSystem() function returns when the child process has ended. While the<br />

QzshSystem() function is waiting for the child process to end, it ignores the<br />

SIGQUIT and SIGINT signals, and blocks the SIGCHLD signal. The QzshSystem()<br />

function does not affect the status information of any other child processes started<br />

by the calling process.<br />

*command<br />

(Input) Pointer to null-terminated string that contains the shell command to run.<br />

Object Referred To Authority Required errno<br />

Each directory in the path<br />

name preceding the<br />

executable file<br />

*X EACCES<br />

Executable file *X EACCES<br />

If executable file is a shell<br />

script<br />

*RX EACCES<br />

value QzshSystem() was successful. The return value is the status returned from<br />

the waitpid() function. An application can use the macros provided in the<br />

sys/wait.h header file to interpret the status information from the child<br />

process. The return value can be a negative number.<br />

-1 Qp0zSystem() was not successful. The errno value is set to indicate the<br />

error.<br />

© Copyright <strong>IBM</strong> Corp. 1998, 1999 113

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!