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 (the "License"). 6 * You may not use this file except in compliance with the License. 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 /* 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _SCHED_H 28 #define _SCHED_H 29 30 #pragma ident "%Z%%M% %I% %E% SMI" 31 32 #include <sys/types.h> 33 #include <time.h> 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 39 struct sched_param { 40 int sched_priority; /* scheduling priority */ 41 int sched_pad[8]; 42 }; 43 44 /* 45 * POSIX scheduling policies 46 */ 47 #define SCHED_OTHER 0 /* traditional time-sharing scheduling class */ 48 #define SCHED_FIFO 1 /* real-time class: run to completion */ 49 #define SCHED_RR 2 /* real-time class: round-robin */ 50 #define SCHED_SYS 3 /* system scheduling class */ 51 #define SCHED_IA 4 /* interactive time-sharing class */ 52 #define SCHED_FSS 5 /* fair-share scheduling class */ 53 #define SCHED_FX 6 /* fixed-priority scheduling class */ 54 #define _SCHED_NEXT 7 /* first unassigned policy number */ 55 56 /* 57 * function prototypes 58 */ 59 #if defined(__STDC__) 60 int sched_getparam(pid_t, struct sched_param *); 61 int sched_setparam(pid_t, const struct sched_param *); 62 int sched_getscheduler(pid_t); 63 int sched_setscheduler(pid_t, int, const struct sched_param *); 64 int sched_yield(void); 65 int sched_get_priority_max(int); 66 int sched_get_priority_min(int); 67 int sched_rr_get_interval(pid_t, struct timespec *); 68 #else 69 int sched_getparam(); 70 int sched_setparam(); 71 int sched_getscheduler(); 72 int sched_setscheduler(); 73 int sched_yield(); 74 int sched_get_priority_max(); 75 int sched_get_priority_min(); 76 int sched_rr_get_interval(); 77 #endif /* __STDC__ */ 78 79 #ifdef __cplusplus 80 } 81 #endif 82 83 #endif /* _SCHED_H */