suser - General: Checks whether the current user is the
#include <sys/proc.h> #include <sys/acct.h>
struct u_cred *cred,
struct flag_field *ac_flag );
Specifies a pointer to the credentials for the current
process. Specifies a pointer to a flag_field structure
that contains accounting flags.
The suser routine checks whether the current user is the
superuser. If the test succeeds and ac_flag is not a null
pointer, the ASU flag is set in the flag_field structure
pointed to by ac_flag. The most common value for ac_flag
is as follows:
You use the suser routine only if the security feature is
not enabled. If the security feature is enabled, use the
privileged routine to determine if the current process has
the appropriate privilege.
If the current user is the superuser, the suser routine
returns the value 0 (zero). Otherwise, it returns an
The current user is not the superuser.
[ Back ]