Make a couple more operator bools explicit
[openal-soft.git] / core / rtkit.h
blobd4994e270d844d6ae27a4472ea6aa3d5ea93ce43
1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
3 #ifndef foortkithfoo
4 #define foortkithfoo
6 /***
7 Copyright 2009 Lennart Poettering
8 Copyright 2010 David Henningsson <diwic@ubuntu.com>
10 Permission is hereby granted, free of charge, to any person
11 obtaining a copy of this software and associated documentation files
12 (the "Software"), to deal in the Software without restriction,
13 including without limitation the rights to use, copy, modify, merge,
14 publish, distribute, sublicense, and/or sell copies of the Software,
15 and to permit persons to whom the Software is furnished to do so,
16 subject to the following conditions:
18 The above copyright notice and this permission notice shall be
19 included in all copies or substantial portions of the Software.
21 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
25 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
26 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 SOFTWARE.
29 ***/
31 #include <sys/types.h>
33 #include "dbus_wrap.h"
35 /* This is the reference implementation for a client for
36 * RealtimeKit. You don't have to use this, but if do, just copy these
37 * sources into your repository */
39 #define RTKIT_SERVICE_NAME "org.freedesktop.RealtimeKit1"
40 #define RTKIT_OBJECT_PATH "/org/freedesktop/RealtimeKit1"
42 /* This is mostly equivalent to sched_setparam(thread, SCHED_RR, {
43 * .sched_priority = priority }). 'thread' needs to be a kernel thread
44 * id as returned by gettid(), not a pthread_t! If 'thread' is 0 the
45 * current thread is used. The returned value is a negative errno
46 * style error code, or 0 on success. */
47 int rtkit_make_realtime(DBusConnection *system_bus, pid_t thread, int priority);
49 /* This is mostly equivalent to setpriority(PRIO_PROCESS, thread,
50 * nice_level). 'thread' needs to be a kernel thread id as returned by
51 * gettid(), not a pthread_t! If 'thread' is 0 the current thread is
52 * used. The returned value is a negative errno style error code, or 0
53 * on success.*/
54 int rtkit_make_high_priority(DBusConnection *system_bus, pid_t thread, int nice_level);
56 /* Return the maximum value of realtime priority available. Realtime requests
57 * above this value will fail. A negative value is an errno style error code.
59 int rtkit_get_max_realtime_priority(DBusConnection *system_bus);
61 /* Retreive the minimum value of nice level available. High prio requests
62 * below this value will fail. The returned value is a negative errno
63 * style error code, or 0 on success.*/
64 int rtkit_get_min_nice_level(DBusConnection *system_bus, int *min_nice_level);
66 /* Return the maximum value of RLIMIT_RTTIME to set before attempting a
67 * realtime request. A negative value is an errno style error code.
69 long long rtkit_get_rttime_usec_max(DBusConnection *system_bus);
71 #endif