X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=libsysio%2Finclude%2Fcreds.h;fp=libsysio%2Finclude%2Fcreds.h;h=672dfcfedc06edf9b3978fe670670a6c8e164340;hb=69b8a5830acdb9077455080cca10a9e9c4622c5d;hp=90305e1d305f294cb1cc56122d07f7427b97044a;hpb=9c1675244bee79ba7d544c15062ee6a1532b1203;p=fs%2Flustre-release.git diff --git a/libsysio/include/creds.h b/libsysio/include/creds.h index 90305e1..672dfcf 100644 --- a/libsysio/include/creds.h +++ b/libsysio/include/creds.h @@ -47,6 +47,11 @@ #define _CREDS_H_ /* + * Superuser's UID. + */ +#define _SYSIO_ROOT_UID 0 + +/* * Data structure for user credentials */ @@ -56,4 +61,12 @@ struct creds { int creds_ngids; }; + +#ifdef _SYSIO_ROOT_UID +/* + * Is caller the superuser? + */ +#define _sysio_is_root(_crp) \ + ((_crp)->creds_uid == _SYSIO_ROOT_UID) +#endif #endif