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);