/*
 * Get scheduler class IDs and priority ranges.
 */
#include <sys/types.h>
#include <sys/priocntl.h>
#include <sys/rtpriocntl.h>
#include <sys/tspriocntl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
main ()
{
	pcinfo_t			pcinfo;
	tsinfo_t			*tsinfop;
	rtinfo_t		*	rtinfop;
	short			maxtsupri, maxrtpri;
	/* timesharing */
		(void) strcpy (pcinfo.pc_clname, "TS");
		if (priocntl (0L, 0L, PC_GETCID, &pcinfo) == -1L) {
			perror ("PC_GETCID failed for timesharing class");
			exit (1);
		}
		tsinfop = (struct tsinfo *) pcinfo.pc_clinfo;
		maxtsupri = tsinfop->ts_maxupri;
		(void) printf("Timesharing: ID %ld, priority range -%d through %d\n",
			pcinfo.pc_cid, maxtsupri, maxtsupri);
	/* realtime */
		(void) strcpy(pcinfo.pc_clname, "RT");
		if (priocntl (0L, 0L, PC_GETCID, &pcinfo) == -1L) {
			perror ("PC_GETCID failed for realtime class");
			exit (2);
		}
	rtinfop = (struct rtinfo *) pcinfo.pc_clinfo;
	maxrtpri = rtinfop->rt_maxpri;
	(void) printf("Realtime: ID %ld, priority range 0 through %d\n",
			pcinfo.pc_cid, maxrtpri);
	return (0);
}
