pbs_statrsc(3B)

NAME
pbs_statrsc - obtain status of PBS resources

SYNOPSIS
#include <pbs_error.h>
#include <pbs_ifl.h>

struct batch_status *pbs_statrsc(int connect, char *name, struct attrl *attrib, char *extend)

void pbs_statfree(struct batch_status *psj)

DESCRIPTION
Issue a batch request to query and return the status of a specified resource, or a set of resources at a server.

A Status Resource batch request is generated and sent to the server over the connection specified by connect.

PARAMETERS
The connect parameter is the file descriptor which is the connection to a PBS server, and is the return value of pbs_connect(). The name parameter is the name of the resource to query. To query all resources at the server, pass NULL as the name.

The attrib parameter is a pointer to a list of attributes to query. If attrib is specified, then only the attributes in the list are returned by the server. Otherwise, all the attributes of a resource are returned. The attrib parameter is a pointer to an attrl structure which is defined in pbs_ifl.h as:

    struct attrl {
        struct attrl *next;
        char         *name;
        char         *resource;
        char         *value;
    };

    The next member is a pointer to the next entry in the list. The attrib list is terminated by the first entry where next is a null pointer. The name member is a pointer to an attribute name. Attribute names are listed in pbs_ifl.h. The resource member is unused. The value member should always be a pointer to a null string.

The extend parameter is unused.

RETURN VALUES and ERRORS
For a single resource, if the resource can be queried, the return value is a pointer to a batch_status structure containing the status of the specified resource. If the resource cannot be queried, a NULL pointer is returned, and pbs_errno is set to an error number. When querying a server, the connection to the server is already established by pbs_connect(). If there are resources at the server, the return value of the query is a pointer to a batch_status structure containing the status of all the queryable resources at the server. In the unlikely event that the server does not contain any queryable resources because the issuer is unprivileged and all resources have the i (invisible) flag set, a NULL pointer ia returned and pbs_errno is set to PBSE_NONE (0). The batch_status structure is defined in pbs_ifl.h as

    struct batch_status {
        struct batch_status *next;
        char                *name;
        struct attrl        *attribs;
        char                *text;
    }

It is up the user to free the structure when no longer needed, by calling pbs_statfree().

SEE ALSO
qstat(1B) and pbs_connect(3B)