2009-03-04 04:28:35 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2008 The Android Open Source Project
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* * Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in
|
|
|
|
* the documentation and/or other materials provided with the
|
|
|
|
* distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
|
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
#ifndef _SCHED_H_
|
|
|
|
#define _SCHED_H_
|
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
|
|
__BEGIN_DECLS
|
|
|
|
|
|
|
|
#define SCHED_NORMAL 0
|
|
|
|
#define SCHED_OTHER 0
|
|
|
|
#define SCHED_FIFO 1
|
|
|
|
#define SCHED_RR 2
|
|
|
|
|
|
|
|
struct sched_param {
|
|
|
|
int sched_priority;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern int sched_setscheduler(pid_t, int, const struct sched_param *);
|
|
|
|
extern int sched_getscheduler(pid_t);
|
|
|
|
extern int sched_yield(void);
|
|
|
|
extern int sched_get_priority_max(int policy);
|
|
|
|
extern int sched_get_priority_min(int policy);
|
|
|
|
extern int sched_setparam(pid_t, const struct sched_param *);
|
|
|
|
extern int sched_getparam(pid_t, struct sched_param *);
|
|
|
|
extern int sched_rr_get_interval(pid_t pid, struct timespec *tp);
|
|
|
|
|
|
|
|
#define CLONE_VM 0x00000100
|
|
|
|
#define CLONE_FS 0x00000200
|
|
|
|
#define CLONE_FILES 0x00000400
|
|
|
|
#define CLONE_SIGHAND 0x00000800
|
|
|
|
#define CLONE_PTRACE 0x00002000
|
|
|
|
#define CLONE_VFORK 0x00004000
|
|
|
|
#define CLONE_PARENT 0x00008000
|
|
|
|
#define CLONE_THREAD 0x00010000
|
|
|
|
#define CLONE_NEWNS 0x00020000
|
|
|
|
#define CLONE_SYSVSEM 0x00040000
|
|
|
|
#define CLONE_SETTLS 0x00080000
|
|
|
|
#define CLONE_PARENT_SETTID 0x00100000
|
|
|
|
#define CLONE_CHILD_CLEARTID 0x00200000
|
|
|
|
#define CLONE_DETACHED 0x00400000
|
|
|
|
#define CLONE_UNTRACED 0x00800000
|
|
|
|
#define CLONE_CHILD_SETTID 0x01000000
|
|
|
|
#define CLONE_STOPPED 0x02000000
|
|
|
|
|
2010-10-09 17:56:55 +02:00
|
|
|
#ifdef _GNU_SOURCE
|
2010-01-23 03:59:05 +01:00
|
|
|
extern int clone(int (*fn)(void *), void *child_stack, int flags, void* arg, ...);
|
|
|
|
#endif
|
2009-03-04 04:28:35 +01:00
|
|
|
|
|
|
|
__END_DECLS
|
|
|
|
|
|
|
|
#endif /* _SCHED_H_ */
|