Dr Andrew Scott G7VAV

My photo
 
April 2024
Mo Tu We Th Fr Sa Su
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 1 2 3 4 5
6 7 8 9 10 11 12


sched.h
001: /* Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface.
002:    Copyright (C) 1996,1997,1999,2001-2004,2007,2010
003:    Free Software Foundation, Inc.
004:    This file is part of the GNU C Library.
005: 
006:    The GNU C Library is free software; you can redistribute it and/or
007:    modify it under the terms of the GNU Lesser General Public
008:    License as published by the Free Software Foundation; either
009:    version 2.1 of the License, or (at your option) any later version.
010: 
011:    The GNU C Library is distributed in the hope that it will be useful,
012:    but WITHOUT ANY WARRANTY; without even the implied warranty of
013:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:    Lesser General Public License for more details.
015: 
016:    You should have received a copy of the GNU Lesser General Public
017:    License along with the GNU C Library; if not, write to the Free
018:    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
019:    02111-1307 USA.  */
020: 
021: #ifndef _SCHED_H
022: #define _SCHED_H        1
023: 
024: #include <features.h>
025: 
026: /* Get type definitions.  */
027: #include <bits/types.h>
028: 
029: #define __need_size_t
030: #include <stddef.h>
031: 
032: #define __need_time_t
033: #define __need_timespec
034: #include <time.h>
035: 
036: #ifndef __pid_t_defined
037: typedef __pid_t pid_t;
038: # define __pid_t_defined
039: #endif
040: 
041: 
042: /* Get system specific constant and data structure definitions.  */
043: #include <bits/sched.h>
044: /* Define the real names for the elements of `struct sched_param'.  */
045: #define sched_priority  __sched_priority
046: 
047: 
048: __BEGIN_DECLS
049: 
050: /* Set scheduling parameters for a process.  */
051: extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
052:      __THROW;
053: 
054: /* Retrieve scheduling parameters for a particular process.  */
055: extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __THROW;
056: 
057: /* Set scheduling algorithm and/or parameters for a process.  */
058: extern int sched_setscheduler (__pid_t __pid, int __policy,
059:                                __const struct sched_param *__param) __THROW;
060: 
061: /* Retrieve scheduling algorithm for a particular purpose.  */
062: extern int sched_getscheduler (__pid_t __pid) __THROW;
063: 
064: /* Yield the processor.  */
065: extern int sched_yield (void) __THROW;
066: 
067: /* Get maximum priority value for a scheduler.  */
068: extern int sched_get_priority_max (int __algorithm) __THROW;
069: 
070: /* Get minimum priority value for a scheduler.  */
071: extern int sched_get_priority_min (int __algorithm) __THROW;
072: 
073: /* Get the SCHED_RR interval for the named process.  */
074: extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW;
075: 
076: 
077: #ifdef __USE_GNU
078: /* Access macros for `cpu_set'.  */
079: # define CPU_SETSIZE __CPU_SETSIZE
080: # define CPU_SET(cpu, cpusetp)   __CPU_SET_S (cpu, sizeof (cpu_set_t), cpusetp)
081: # define CPU_CLR(cpu, cpusetp)   __CPU_CLR_S (cpu, sizeof (cpu_set_t), cpusetp)
082: # define CPU_ISSET(cpu, cpusetp) __CPU_ISSET_S (cpu, sizeof (cpu_set_t), \
083:                                                 cpusetp)
084: # define CPU_ZERO(cpusetp)       __CPU_ZERO_S (sizeof (cpu_set_t), cpusetp)
085: # define CPU_COUNT(cpusetp)      __CPU_COUNT_S (sizeof (cpu_set_t), cpusetp)
086: 
087: # define CPU_SET_S(cpu, setsize, cpusetp)   __CPU_SET_S (cpu, setsize, cpusetp)
088: # define CPU_CLR_S(cpu, setsize, cpusetp)   __CPU_CLR_S (cpu, setsize, cpusetp)
089: # define CPU_ISSET_S(cpu, setsize, cpusetp) __CPU_ISSET_S (cpu, setsize, \
090:                                                            cpusetp)
091: # define CPU_ZERO_S(setsize, cpusetp)       __CPU_ZERO_S (setsize, cpusetp)
092: # define CPU_COUNT_S(setsize, cpusetp)      __CPU_COUNT_S (setsize, cpusetp)
093: 
094: # define CPU_EQUAL(cpusetp1, cpusetp2) \
095:   __CPU_EQUAL_S (sizeof (cpu_set_t), cpusetp1, cpusetp2)
096: # define CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
097:   __CPU_EQUAL_S (setsize, cpusetp1, cpusetp2)
098: 
099: # define CPU_AND(destset, srcset1, srcset2) \
100:   __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, &)
101: # define CPU_OR(destset, srcset1, srcset2) \
102:   __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, |)
103: # define CPU_XOR(destset, srcset1, srcset2) \
104:   __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, ^)
105: # define CPU_AND_S(setsize, destset, srcset1, srcset2) \
106:   __CPU_OP_S (setsize, destset, srcset1, srcset2, &)
107: # define CPU_OR_S(setsize, destset, srcset1, srcset2) \
108:   __CPU_OP_S (setsize, destset, srcset1, srcset2, |)
109: # define CPU_XOR_S(setsize, destset, srcset1, srcset2) \
110:   __CPU_OP_S (setsize, destset, srcset1, srcset2, ^)
111: 
112: # define CPU_ALLOC_SIZE(count) __CPU_ALLOC_SIZE (count)
113: # define CPU_ALLOC(count) __CPU_ALLOC (count)
114: # define CPU_FREE(cpuset) __CPU_FREE (cpuset)
115: 
116: 
117: /* Set the CPU affinity for a task */
118: extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
119:                               __const cpu_set_t *__cpuset) __THROW;
120: 
121: /* Get the CPU affinity for a task */
122: extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
123:                               cpu_set_t *__cpuset) __THROW;
124: #endif
125: 
126: __END_DECLS
127: 
128: #endif /* sched.h */
129: 


for client 18.116.118.244
© Andrew Scott 2006 - 2024,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/