Git init
[framework/multimedia/pulseaudio.git] / src / pulsecore / rtkit.h
1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
2
3 #ifndef foortkithfoo
4 #define foortkithfoo
5
6 /***
7   Copyright 2009 Lennart Poettering
8
9   Permission is hereby granted, free of charge, to any person
10   obtaining a copy of this software and associated documentation files
11   (the "Software"), to deal in the Software without restriction,
12   including without limitation the rights to use, copy, modify, merge,
13   publish, distribute, sublicense, and/or sell copies of the Software,
14   and to permit persons to whom the Software is furnished to do so,
15   subject to the following conditions:
16
17   The above copyright notice and this permission notice shall be
18   included in all copies or substantial portions of the Software.
19
20   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
24   BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
25   ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26   CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27   SOFTWARE.
28 ***/
29
30 #include <sys/types.h>
31 #include <dbus/dbus.h>
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 /* This is the reference implementation for a client for
38  * RealtimeKit. You don't have to use this, but if do, just copy these
39  * sources into your repository */
40
41 #define RTKIT_SERVICE_NAME "org.freedesktop.RealtimeKit1"
42 #define RTKIT_OBJECT_PATH "/org/freedesktop/RealtimeKit1"
43
44 /* This is mostly equivalent to sched_setparam(thread, SCHED_RR, {
45  * .sched_priority = priority }). 'thread' needs to be a kernel thread
46  * id as returned by gettid(), not a pthread_t! If 'thread' is 0 the
47  * current thread is used. The returned value is a negative errno
48  * style error code, or 0 on success. */
49 int rtkit_make_realtime(DBusConnection *system_bus, pid_t thread, int priority);
50
51 /* This is mostly equivalent to setpriority(PRIO_PROCESS, thread,
52  * nice_level). 'thread' needs to be a kernel thread id as returned by
53  * gettid(), not a pthread_t! If 'thread' is 0 the current thread is
54  * used. The returned value is a negative errno style error code, or 0
55  * on success.*/
56 int rtkit_make_high_priority(DBusConnection *system_bus, pid_t thread, int nice_level);
57
58 #ifdef __cplusplus
59 }
60 #endif
61
62 #endif