HP-UX Reference (11i v1 00/12) - 3 Library Functions N-Z (vol 7)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/nan.3m
________________________________________________________________
___ ___
r
rcmd(3N) rcmd(3N)
Error in reading information from the standard socket connection. Appended to this error is a
message explaining the reason for the error.
Connection timeout
The remote host did not connect within 30 seconds to the secondary socket set up as an error
connection.
Lost connection
The program attempted to read from the socket and failed. This means the socket connection
with the remote host was lost.
message...
An error message can be transmitted through the socket connection from the daemon. That
message will be sent to stderr.
primary connection shutdown
While waiting for the secondary socket to be set up, rcmd() had its primary connection shut
down. This may have been caused by an inetd security failure.
recv: ...
While trying to set up the secondary (stderr) socket, rcmd() had an error condition on its
primary connection.
accept: Interrupted system call
While trying to set up its secondary socket, rcmd() ran out of some resource that caused the
accept to be timed out.
Next step: Repeat the command.
rresvport() Diagnostic Messages
rresvport() generates the following diagnostic messages. These messages can also appear in rcmd()
since rcmd() calls rresvport().
system call: ...
Error in executing the system call. The error message returned by the system call is appended
to the message.
socket: All ports in use
All reserved ports in use. If a timeout occurs, check whether the Internet Services are installed
and inetd is running.
EXAMPLES
To execute the date command on remote host hpxzgy using the remote account chm, call rcmd() as
shown below. This program requires superuser privileges and the remote account must be equivalent (see
hosts.equiv(4)) to the local account that runs the program.
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#include <pwd.h>
struct passwd *getpwuid();
char *host[] = { "hpxzgy" };
char *cmd = "date";
char *ruser = "chm";
main(argc,argv)
int argc;
char **argv;
{
struct servent *sp;
struct passwd *pwd;
HP-UX Release 11i: December 2000 3 Section 3747
___
___