Trusted Solaris Developer's Guide

Getting the X Window Server Workstation Owner ID

This example gets the ID of the user logged in to X Window Server. The process sensitivity label equals the window sensitivity label so no privileges are required.

/* Get the user ID of the window */
	retval = XTSOLgetWorkstationOwner(display, &uid);