/*
 * Change realtime priorities of this uid
 * to highest realtime priority minus 1.
 */
main (argc, argv)
		int 		argc;
		char		*argv[];
{
		procset_t			procset;
		pcparms_t			pcparms;
		struct 			rtparms		*rtparmsp;
		id_t			rtclassID;
		id_t			schedinfo();
		short			maxrtpri;
		/* left set: select processes with same uid as this process */
		procset.p_lidtype = P_UID;
		procset.p_lid = getuid();
		/* get info on realtime class */
		if ((rtclassID = schedinfo ("RT", &maxrtpri)) == -1) {
			perror ("schedinfo failed");
			exit (1);
		}
		/* right set: select realtime processes */
		procset.p_ridtype = P_CID;
		procset.p_rid = rtclassID;
		/* select only my RT processes */
		procset.p_op = POP_AND;
		/* specify new scheduler parameters */
		pcparms.pc_cid = rtclassID;
		rtparmsp = (struct rtparms *) pcparms.pc_clparms;
		rtparmsp->rt_pri = maxrtpri - 1;
		rtparmsp->rt_tqnsecs = RT_NOCHANGE;
		if (priocntlset (&procset, PC_SETPARMS, &pcparms) == -1) {
			perror ("priocntlset failed");
			exit (2);
		}
}
