LABEQ(3)

NAME
labeq, lable, labmax, labmin - compare security labels

SYNOPSIS
#include <sys/label.h>

labEQ(x, y)
struct label *x, *y;

labLE(x, y)
struct label *x, *y;

struct label labMAX(x, y)
struct label *x, *y;

struct label labMIN(x, y)
struct label *x, *y;

DESCRIPTION
LabEQ returns 1 if x and y point to equal labels, otherwise 0. The result is 1 if and only if neither argument is 0, the flag fields are the same, and, when the flag fields are L_BITS, the lattice values are the same.

LabLE returns 1 if the security label pointed to by x compares less than or equal to the security label pointed to by y. An improper argument is treated as if it had flag L_NO. If one of the labels has flag L_YES, the result is 1; otherwise if one of the labels has flag L_NO, the result is 0; otherwise the the result is 1 if and only if the lattice value of x is bitwise less than or equal to the lattice value of y. (Inequalities involving L_YES and L_NO are not transitive.)

LabMAX and labMIN respectively return the maximum (bitwise OR) and minimum (bitwise AND) of lattice values of labels pointed to by x and y. An improper argument is treated as if it had flag L_NO. If one of the labels has flag L_YES, the result is the other label; otherwise if one of the labels has flag L_NO, the result has flag L_NO.

The privilege and frozen-label fields of the labels are disregarded by all of these functions.

SEE ALSO
getflab(2)