Verifying the Locality Group Interface Version
The lgrp_version()
function must be used to verify the presence of a
supported lgroup interface before using the lgroup API. The
lgrp_version()
function has the following syntax:
#include <sys/lgrp_user.h> int lgrp_version(const int version);
The lgrp_version()
function takes an interface version number as an
argument and returns the lgroup interface version that the system supports. The
lgrp_version()
function returns the version number if the lgroup
API supports the version number in the version argument. Otherwise,
the lgrp_version()
function returns LGRP_VER_NONE.
For more information, see the
lgrp_version(3LGRP) man page.
Example 4-1 Using lgrp_version()
#include <sys/lgrp_user.h>
if (lgrp_version(LGRP_VER_CURRENT) != LGRP_VER_CURRENT) {
fprintf(stderr, "Built with unsupported lgroup interface %d\n",
LGRP_VER_CURRENT);
exit (1);
}