if (pw->pw_uid == 0 && wheel_test() == 0)
error (1, 0, _("not memeber of wheel group"));
The error message can be anything.
/* Return 1 if the current process (calling
user) is a member of the wheel group. */
int
wheel_test (void)
{
struct group *whgrp;
gid_t grps[NGROUPS_MAX];
int ngrps=0, grpn=0, match=0;
whgrp = getgrnam("wheel");
ngrps = getgroups(NGROUPS_MAX, (gid_t *) &grps);
if(whgrp && ngrps)
for(grpn=0; grpn<=ngrps; grpn++)
if(grps[grpn]==whgrp->gr_gid)
match=1;
free(whgrp);
return match;
}