LM_USERLIST(3)

NAME
lm_userlist - returns the list of users for a specified feature

SYNOPSIS
#include <lm_client.h>

LM_USERS *lm_userlist(feature)
char *feature;

typedef struct lm_users {
	struct lm_users *next;
	char name[MAX_USER_NAME + 1];
	char node[MAX_SERVER_NAME + 1];
	char display[MAX_DISPLAY_NAME + 1];
	int nlic;	/* Number of licenses */
	short opts;	/* options flag */
#define INQUEUE		0x1	/* User is in queue */
#define HOSTRES		0x2	/* Reservation for a host "node" */
#define USERRES		0x4	/* Reservation for user "name" */
#define DISPLAYRES	0x8	/* Reservation for display "name" */
#define GROUPRES	0x10	/* Reservation for group "name" */
#define lm_isres(x) ((x) & (HOSTRES | USERRES | DISPLAYRES | GROUPRES))
			/* This is a reservation */
	long time;		/* Seconds value from timeval */
	double version;	/* Version of software */
} LM_USERS;

DESCRIPTION
lm_userlist() returns information about who is using a particular license.

RETURN VALUE
lm_userlist() returns a pointer to a linked list of structures, one for each user of the license. This data should not be modified by the caller. It will be freed on the next call to lm_userlist.

The list of users returned by lm_userlist() includes a special record, indicated by an empty username (name[0]==0), which contains the total number of licenses supported by the daemon for the specified feature (in the nlic field), and the daemon's idea of the current time (in the time field).

If there is an error, lm_userlist() returns NULL and sets the global variable _lm_errno with the error code.

lm_userlist() only returns information about users of floating licenses, therefore it will not return any information about users of node-locked uncounted, or DEMO licenses.

SEE ALSO
lm_feat_list(3).