SUSER(9)

NAME
suser - test for super-user credentials

SYNOPSIS
#include <sys/param.h>
#include <sys/ucred.h>
#include <sys/acct.h>
int
suser(struct ucred *cred, u_short *acflag);

DESCRIPTION
suser() tests whether the specified credentials cred imply super-user privilege. The argument acflag, if non-NULL, is a pointer to the ac_flag in the accounting structure. If super-user privilege is implied by the credentials, and acflag is not NULL, the ASU flags is set in acflag to indicate the use of super-powers.

suser() returns zero on success, or EPERM if super-user privilege is not implied by the credentials.