PRIVGRP(4) — HP-UX
Series 200, 300, 800 Only
NAME
privgrp − format of privileged values
SYNOPSIS
#include <sys/privgrp.h>
DESCRIPTION
Setprivgrp(2) sets a mask of privileges, and getprivgrp(2) returns an array of structures giving privileged group assignments on a per group−id basis. Privgrp.h contains the constants and structures needed to deal with these system calls, and contains:
/*
* Privileged group definitions --
* the numeric values may vary between implementations.
*/
#define PRIV_RTPRIO 1
#define PRIV_MLOCK 2
#define PRIV_CHOWN 3
/* Maximum number of privileged groups in system */
#define PRIV_MAXGRPS 32
/*
* Size of the privilege mask,
* based on largest numbered privilege
*/
#define PRIV_MASKSIZ 1
/*
* Structure defining the privilege mask
*/
struct privgrp_map {
int priv_groupno;
unsigned int priv_mask[PRIV_MASKSIZ];
};
PRIV_RTPRIO allows access to the rtprio(2) system call.
PRIV_MLOCK allows access to the plock(2) system call.
PRIV_CHOWN allows access to the chown(2) system calls.
Privileges are described in a multi−word mask. The value of the #define for each privilege is interpreted as a bit index (counting from 1). Thus a group−id may have several different privileges associated with it by having different bits or’ed into the mask.
The system is configured with a maximum number of groups with special privileges. PRIV_MAXGRPS defines this maximum. Of this maximum, one is reserved for global privileges (granted to all processes), and the remainder can be assigned to actual group−ids.
PRIV_MASKSIZ defines the size of the multi−word mask used defining privileges associated with a group−id.
Privileges are returned to the user from the getprivgrp(2) system call in an array of structures of type struct privgrp_map. The structure associates a multi−word mask with a group−id.
SEE ALSO
Hewlett-Packard Company — Version B.1, May 11, 2021