build-sys: Use ax_check_flag macros from autoconf archive
[pulseaudio-mirror.git] / src / pulsecore / rtkit.h
blob2081b4e9af4b96d78517aa300cf428b08717e0e9
1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
3 #ifndef foortkithfoo
4 #define foortkithfoo
6 /***
7 Copyright 2009 Lennart Poettering
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:
17 The above copyright notice and this permission notice shall be
18 included in all copies or substantial portions of the Software.
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 ***/
30 #include <sys/types.h>
31 #include <dbus/dbus.h>
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
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 */
41 #define RTKIT_SERVICE_NAME "org.freedesktop.RealtimeKit1"
42 #define RTKIT_OBJECT_PATH "/org/freedesktop/RealtimeKit1"
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);
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);
58 #ifdef __cplusplus
60 #endif
62 #endif