/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
/* a sample program that prints the current group
id and user id. */
#include <stdio.h>
#include <unistd.h>

int main() {
    gid_t egid;
    uid_t euid;
    gid_t gid;
    uid_t uid;

    gid  = 345;
    setgid(gid);
    egid = getegid();
    euid = geteuid();
    gid  = getgid();
    uid  = getuid();    
    printf(" Effective user ID of the current process is %d\n",euid);
    printf(" Effective group ID of the current process is %d\n",egid);
    printf(" Real group ID of the current process is %d\n",gid);
    printf(" Real user ID of the current process is %d\n",uid);
}
