HP-UX Reference (11i v2 04/09) - 3 Library Functions N-Z (vol 7)
r
rcmd(3N) rcmd(3N)
Error writing to the socket connection set up for error message transmission.
system call
: ...
Error executing the system call. Appended to this error is a message specifying the reason for
the failure.
socket: Protocol failure in circuit setup
Socket connection not established on a reserved port or socket address not of the Internet fam-
ily type.
read: hostname : ...
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>
Section 3−−860 Hewlett-Packard Company − 3 − HP-UX 11i Version 2: September 2004