4.3BSD/usr/guest/sam/tests/setuid.c

Compare this file to the similar file:
Show the results in this format:

main()
{
	int uid;

	printf("euid=%d ruid=%d\n", geteuid(), uid = getuid());
	if (setuid(uid) < 0)
		perror("setuid");
	printf("euid=%d ruid=%d\n", geteuid(), uid = getuid());
}