suser --
determine if current user is the superuser
Synopsis
int suser(void);
Description
suser checks whether the process's EUID is that
of the superuser (root). This can be useful, for example, in
determining whether special device operations (such as disk
formatting) are allowed.
Arguments
None.
Return values
suser returns 0 (zero) if the current user is not the
superuser; u.u_error is set to EPERM.
suser returns 1 if the current user is the superuser.
SVR5 systems use a credential structure
to control privileges.
Use the
drv_priv(D3)
function to check if the user process is privileged.
Note, however, that
drv_priv( )
does not set EPERM in u.u_error
so modifications are required for applications
that depend on this behavior.