DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

suser(D3oddi)


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.

Usage

Context and synchronization

User context.

Hardware applicability

All

Version applicability

oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

SVR5 DDI compatibility

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.

References

setuid(S)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005