Knowledge Center         Contents    Previous  Next    
Platform Computing Corp.

ls_readconfenv()

Reads the LSF configuration parameters from the *confPath/lsf.conf file.

DESCRIPTION

ls_readconfenv() reads the LSF configuration parameters from the *confPath/lsf.conf file. If confPath is NULL, the LSF configurable parameters are read from the ${LSF_ENVDIR-/etc}/lsf.conf file. See lsf.conf. The input paramList is an array of data structures that are defined in <lsf/lsf.h>. The paramName parameter in the config_param data structure should be the pointer to the configuration parameter name defined in the *confPath/lsf.conf or /etc/lsf.conf file if confPath is NULL. The paramValue parameter in the config_param data structure must initially contain NULL and is then modified to point to a result string if a matching paramName is found in the lsf.conf file. A typical data structure declaration is as follows:

struct config_param paramList[] =
{
#define LSF_CONFDIR  0
    {"LSF_CONFDIR", NULL},
#define LSF_LOGDIR   1
    {"LSF_LOGDIR", NULL},
#define LSF_SERVERDIR 2
    {"LSF_SERVERDIR", NULL},
#define LSF_RES_DEBUG 3
    {"LSF_RES_DEBUG", NULL},
#define LSF_NPARAMS  4
    {NULL, NULL},
}; 

By calling ls_readconfenv(paramList, "/localpath/etc"), it is possible to read in the required parameters and use the defined constants as indices for referencing the parameters when needed. If a certain parameter name is not found in the lsf.conf file, then its paramValue will remain NULL on return.

SYNOPSIS

#include <lsf/lsf.h> 
int ls_readconfenv(struct config_param *paramList, 
                               char *confPath)

struct config_param {
    char *paramName;
    char *paramValue;
}; 

PARAMETERS

*paramlist

An array of data structures that are defined in <lsf/lsf.h>.

paramname

The pointer to the configuration parameter name defined in the *confPath/lsf.conf or /etc/lsf.conf file if confPath is NULL.

*paramValue

The config_param data structure must initially contain NULL and is then modified to point to a result string if a matching paramName is found in the lsf.conf file.

RETURN VALUES

integer:0

Function was successful.

integer:-1

Function failed.

ERRORS

If the function fails, lserrno is set to indicate the error.

SEE ALSO

Related APIs

none

Equivalent line command

none

Files

${LSF_ENVDIR-/etc}/lsf.conf


Platform Computing Inc.
www.platform.com
Knowledge Center         Contents    Previous  Next