rtpriocntl.c (7c478bd95313f5f23a4c958a745db2134aa03244) rtpriocntl.c (d4204c85a44d2589b9afff2c81db7044e97f2d1d)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
22/*
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#pragma ident "%Z%%M% %I% %E% SMI"
28
29/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
30/* All Rights Reserved */
31

--- 51 unchanged lines hidden (view full) ---

83static char cmdpath[MAXPATHLEN];
84static char basenm[BASENMSZ];
85
86
87int
88main(int argc, char *argv[])
89{
90 int c;
24 * Use is subject to license terms.
25 */
26
27#pragma ident "%Z%%M% %I% %E% SMI"
28
29/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
30/* All Rights Reserved */
31

--- 51 unchanged lines hidden (view full) ---

83static char cmdpath[MAXPATHLEN];
84static char basenm[BASENMSZ];
85
86
87int
88main(int argc, char *argv[])
89{
90 int c;
91 int lflag, dflag, sflag, pflag, tflag, rflag, eflag, iflag;
92 int qflag;
91 int lflag, dflag, sflag, pflag;
92 int tflag, rflag, eflag, iflag, qflag;
93 pri_t rtpri;
94 long tqntm;
95 long res;
96 int tqsig;
97 char *idtypnm;
98 idtype_t idtype;
99 int idargc;
100 uint_t cflags;
101
102 (void) strlcpy(cmdpath, argv[0], MAXPATHLEN);
103 (void) strlcpy(basenm, basename(argv[0]), BASENMSZ);
93 pri_t rtpri;
94 long tqntm;
95 long res;
96 int tqsig;
97 char *idtypnm;
98 idtype_t idtype;
99 int idargc;
100 uint_t cflags;
101
102 (void) strlcpy(cmdpath, argv[0], MAXPATHLEN);
103 (void) strlcpy(basenm, basename(argv[0]), BASENMSZ);
104 qflag =
105 lflag = dflag = sflag = pflag = tflag = rflag = eflag = iflag = 0;
104 lflag = dflag = sflag = pflag = 0;
105 tflag = rflag = eflag = iflag = qflag = 0;
106 while ((c = getopt(argc, argv, "ldsp:t:r:q:ec:i:")) != -1) {
107 switch (c) {
108
109 case 'l':
110 lflag++;
111 break;
112
113 case 'd':

--- 127 unchanged lines hidden (view full) ---

241 fatalerr(usage);
242 }
243
244 return (0);
245}
246
247
248/*
106 while ((c = getopt(argc, argv, "ldsp:t:r:q:ec:i:")) != -1) {
107 switch (c) {
108
109 case 'l':
110 lflag++;
111 break;
112
113 case 'd':

--- 127 unchanged lines hidden (view full) ---

241 fatalerr(usage);
242 }
243
244 return (0);
245}
246
247
248/*
249 * Print our class name and the maximum configured real-time priority.
249 * Print our class name and the configured user priority range.
250 */
251static void
252print_rtinfo(void)
253{
254 pcinfo_t pcinfo;
255
256 (void) strcpy(pcinfo.pc_clname, "RT");
257
258 (void) printf("RT (Real Time)\n");
259
260 if (priocntl(0, 0, PC_GETCID, (caddr_t)&pcinfo) == -1)
261 fatalerr("\tCan't get maximum configured RT priority\n");
262
250 */
251static void
252print_rtinfo(void)
253{
254 pcinfo_t pcinfo;
255
256 (void) strcpy(pcinfo.pc_clname, "RT");
257
258 (void) printf("RT (Real Time)\n");
259
260 if (priocntl(0, 0, PC_GETCID, (caddr_t)&pcinfo) == -1)
261 fatalerr("\tCan't get maximum configured RT priority\n");
262
263 (void) printf("\tMaximum Configured RT Priority: %d\n",
263 (void) printf("\tConfigured RT User Priority Range: 0 through %d\n",
264 ((rtinfo_t *)pcinfo.pc_clinfo)->rt_maxpri);
265}
266
267
268/*
269 * Read a list of pids from stdin and print the real-time priority and time
270 * quantum (in millisecond resolution) for each of the corresponding processes.
271 */

--- 253 unchanged lines hidden ---
264 ((rtinfo_t *)pcinfo.pc_clinfo)->rt_maxpri);
265}
266
267
268/*
269 * Read a list of pids from stdin and print the real-time priority and time
270 * quantum (in millisecond resolution) for each of the corresponding processes.
271 */

--- 253 unchanged lines hidden ---