Standards / Extensions | C or C++ | Dependencies |
---|---|---|
z/OS® UNIX | both | POSIX(ON) |
#include <rexec.h>
int rexec(char **Host, int Port, char *User, char *Password,
char *Command, int *ErrFileDescParam)
The rexec (remote execution) subroutine allows the calling process to execute commands on a remote host. If the rexec connection succeeds, a socket in the Internet domain of type SOCK_STREAM is returned to the calling process and is given to the remote command as standard input and standard output.
Host contains the name of a remote host that is listed in the /etc/hosts file or /etc/resolv.config file. If the name of the host is not found in either file, the rexec fails.
Port specifies the well-known Defense Advanced Research Projects Agency (DARPA) Internet port to use for the connection. A pointer to the structure that contains the necessary port can be obtained by issuing the following library call: getservbyname("exec","tcp").
User and Password points to a user ID and password valid at the host. Password phrases are not supported.
Command points to the name of the command to be executed at the remote host.
This function is supported only in a POSIX program.
If rexec() is successful, the system returns a socket to the remote command.
If rexec() is unsuccessful, the system returns a -1 indicating that the specified host name does not exist.