xref: /onnv-gate/usr/src/head/sched.h (revision 6247:ad4c702ff226)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*6247Sraf  * Common Development and Distribution License (the "License").
6*6247Sraf  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
21*6247Sraf 
220Sstevel@tonic-gate /*
23*6247Sraf  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef	_SCHED_H
280Sstevel@tonic-gate #define	_SCHED_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #include <sys/types.h>
330Sstevel@tonic-gate #include <time.h>
340Sstevel@tonic-gate 
350Sstevel@tonic-gate #ifdef	__cplusplus
360Sstevel@tonic-gate extern "C" {
370Sstevel@tonic-gate #endif
380Sstevel@tonic-gate 
390Sstevel@tonic-gate struct sched_param {
40*6247Sraf 	int	sched_priority;	/* scheduling priority */
41*6247Sraf 	int	sched_pad[8];
420Sstevel@tonic-gate };
430Sstevel@tonic-gate 
440Sstevel@tonic-gate /*
45*6247Sraf  * POSIX scheduling policies
460Sstevel@tonic-gate  */
47*6247Sraf #define	SCHED_OTHER	0	/* traditional time-sharing scheduling class */
48*6247Sraf #define	SCHED_FIFO	1	/* real-time class: run to completion */
49*6247Sraf #define	SCHED_RR	2	/* real-time class: round-robin */
50*6247Sraf #define	SCHED_SYS	3	/* system scheduling class */
51*6247Sraf #define	SCHED_IA	4	/* interactive time-sharing class */
52*6247Sraf #define	SCHED_FSS	5	/* fair-share scheduling class */
53*6247Sraf #define	SCHED_FX	6	/* fixed-priority scheduling class */
54*6247Sraf #define	_SCHED_NEXT	7	/* first unassigned policy number */
550Sstevel@tonic-gate 
560Sstevel@tonic-gate /*
570Sstevel@tonic-gate  * function prototypes
580Sstevel@tonic-gate  */
590Sstevel@tonic-gate #if	defined(__STDC__)
600Sstevel@tonic-gate int	sched_getparam(pid_t, struct sched_param *);
610Sstevel@tonic-gate int	sched_setparam(pid_t, const struct sched_param *);
620Sstevel@tonic-gate int	sched_getscheduler(pid_t);
630Sstevel@tonic-gate int	sched_setscheduler(pid_t, int, const struct sched_param *);
640Sstevel@tonic-gate int	sched_yield(void);
650Sstevel@tonic-gate int	sched_get_priority_max(int);
660Sstevel@tonic-gate int	sched_get_priority_min(int);
670Sstevel@tonic-gate int	sched_rr_get_interval(pid_t, struct timespec *);
680Sstevel@tonic-gate #else
690Sstevel@tonic-gate int	sched_getparam();
700Sstevel@tonic-gate int	sched_setparam();
710Sstevel@tonic-gate int	sched_getscheduler();
720Sstevel@tonic-gate int	sched_setscheduler();
730Sstevel@tonic-gate int	sched_yield();
740Sstevel@tonic-gate int	sched_get_priority_max();
750Sstevel@tonic-gate int	sched_get_priority_min();
760Sstevel@tonic-gate int	sched_rr_get_interval();
770Sstevel@tonic-gate #endif	/* __STDC__ */
780Sstevel@tonic-gate 
790Sstevel@tonic-gate #ifdef	__cplusplus
800Sstevel@tonic-gate }
810Sstevel@tonic-gate #endif
820Sstevel@tonic-gate 
830Sstevel@tonic-gate #endif	/* _SCHED_H */
84