zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

sched.h (2080B) - Raw


      1 /*
      2    Copyright (c) 2011-2016  mingw-w64 project
      3 
      4    Permission is hereby granted, free of charge, to any person obtaining a
      5    copy of this software and associated documentation files (the "Software"),
      6    to deal in the Software without restriction, including without limitation
      7    the rights to use, copy, modify, merge, publish, distribute, sublicense,
      8    and/or sell copies of the Software, and to permit persons to whom the
      9    Software is furnished to do so, subject to the following conditions:
     10 
     11    The above copyright notice and this permission notice shall be included in
     12    all copies or substantial portions of the Software.
     13 
     14    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     15    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     16    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     17    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     18    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     19    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
     20    DEALINGS IN THE SOFTWARE.
     21 */
     22 #ifndef WIN_PTHREADS_SCHED_H
     23 #define WIN_PTHREADS_SCHED_H
     24 
     25 #include <stddef.h>
     26 #include <errno.h>
     27 #include <sys/types.h>
     28 
     29 #include <process.h>
     30 #include <limits.h>
     31 #include <signal.h>
     32 
     33 #include "pthread_compat.h"
     34 
     35 /* Some POSIX realtime extensions, mostly stubbed */
     36 #define SCHED_OTHER     0
     37 #define SCHED_FIFO      1
     38 #define SCHED_RR        2
     39 #define SCHED_MIN       SCHED_OTHER
     40 #define SCHED_MAX       SCHED_RR
     41 
     42 struct sched_param {
     43   int sched_priority;
     44 };
     45 
     46 #ifdef __cplusplus
     47 extern "C" {
     48 #endif
     49 
     50 WINPTHREAD_API int sched_yield(void);
     51 WINPTHREAD_API int sched_get_priority_min(int pol);
     52 WINPTHREAD_API int sched_get_priority_max(int pol);
     53 WINPTHREAD_API int sched_getscheduler(pid_t pid);
     54 WINPTHREAD_API int sched_setscheduler(pid_t pid, int pol, const struct sched_param *param);
     55 
     56 #ifdef __cplusplus
     57 }
     58 #endif
     59 
     60 #ifndef sched_rr_get_interval
     61 #define sched_rr_get_interval(_p, _i) \
     62   ( errno = ENOTSUP, (int) -1 )
     63 #endif
     64 
     65 #endif /* WIN_PTHREADS_SCHED_H */