RM(3)
π RM(3) β the resource monitor API, explained by your fave Unix bestie
okay so bestie, this is RM(3) from PBS Professional, and it's genuinely one of those pages that looks scary until someone (me, hi π«Ά) walks you through it. it's the library that lets your code talk to the PBS Professional resource monitor, and it's built so you can juggle several resource monitors at once without the network stuff making you cry. let's get into it β¨
β¨ NAME β¨
openrm, closerm, downrm, configrm, addreq, allreq, getreq, flushreq, activereq, fullresp β that's the whole resource monitor API squad, all ten of them, no cap π
πΈ SYNOPSIS πΈ
here's the lineup, literally copy these exactly:
#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 π¦
so. the resource monitor library has functions that make talking to the PBS Professional resource monitor actually pleasant π. the whole point is that it's set up so connecting to several resource monitors is easy and the network communication is handled efficiently β main character energy, honestly.
in all of these routines, the variable pbs_errno gets set whenever an error is indicated. remember that, it's your bestie when things go sideways π. the lower levels of the 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. it's Deprecated, so likeβ¦ don't build your whole personality around it, okay? πaddreq()β begins a new message to the resource monitor if necessary. then it 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 π₯. here's the important bit: iffullresp()has been called to turn off "full response" mode, this routine searches down the line to find the equal sign just before the response value. the returned string (if it is notNULL) has been allocated bymalloc, sofreemust be called when it's no longer needed β otherwise, memory leaks, and we do not stan 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 gets sent and the internal structure is marked to show "waiting for response".fullresp()β turns on, if flag is true, "full response" mode, wheregetreq()returns a pointer to the beginning of a line of response. this is the default, bestie π. if flag is false, the line returned bygetreq()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 fromrpp_poll) if there is no stream to read.
πͺ windows girlies listen up: in order to use any of the above with Windows, you gotta initialize the network library and link withwinsock2. to do this, callwinsock_init()before calling the function, and link against thews2_32.liblibrary. do it in that order, fr fr π
π SEE ALSO π
tcp(4P)udp(4P)
that's the whole page, you ate that π
. this lil gem is from the Local source, version dated 6 March 2019, and yes, it's still filed under RM(3) β go forth and monitor those resources, icon π§π
π¦ where this page comes from
- nixos 26.05: openpbs 23.06.06-unstable-2026-04-02
- nixpkgs unstable: openpbs 23.06.06-unstable-2026-04-02
- Copyright (C) 1994-2021 Altair Engineering, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms