RM(3)

NAME
openrm, closerm, downrm, configrm, addreq, allreq, getreq, flushreq, activereq, fullresp - resource monitor API

SYNOPSIS
#include <sys/types.h>
#include <netinet/in.h>
#include <rm.h>

int openrm (host, port)
    char *host;
    unsigned int port;

int closerm (stream)
    int stream;

int downrm (stream)
    int stream;

int configrm (stream, file)
    int stream;
    char *file;

int addreq (stream, line)
    int stream;
    char *line;

int allreq (line)
    char *line;

char *getreq(stream)
    int stream;

int flushreq()

int activereq()

void fullresp(flag)
    int flag;

DESCRIPTION

The resource monitor library contains functions to facilitate communication with the PBS Professional resource monitor. It is set up to make it easy to connect to several resource monitors and handle the network communication efficiently.

In all these routines, the variable pbs_errno will be set when an error is indicated. The lower levels of network protocol are handled by the "Data Is Strings" DIS library and the "Reliable Packet Protocol" RPP library.

configrm() causes the resource monitor to read the file named. Deprecated.

addreq() begins a new message to the resource monitor if necessary. Then adds a line to the body of an outstanding command to the resource monitor.

allreq() begins, for each stream, a new message to the resource monitor if necessary. Then adds a line to the body of an outstanding command to the resource monitor.

getreq() finishes and sends any outstanding message to the resource monitor. If fullresp() has been called to turn off "full response" mode, the routine searches down the line to find the equal sign just before the response value. The returned string (if it is not NULL) has been allocated by malloc and thus free must be called when it is no longer needed to prevent memory leaks.

flushreq() finishes and sends any outstanding messages to all resource monitors. For each active resource monitor structure, it checks if any outstanding data is waiting to be sent. If there is, it is sent and the internal structure is marked to show "waiting for response".

fullresp() turns on, if flag is true, "full response" mode where getreq() returns a pointer to the beginning of a line of response. This is the default. If flag is false, the line returned by getreq() is just the answer following the equal sign.

activereq() Returns the stream number of the next stream with something to read or a negative number (the return from rpp_poll ) if there is no stream to read. In order to use any of the above with Windows, initialize the network library and link with winsock2. To do this, call winsock_init() before calling the function and link against the ws2_32.lib library.

SEE ALSO
rpp(3B), tcp(4P), udp(4P)