PipeWire: rtkit.h Source File

PipeWire 0.1.5.1

rtkit.h
Go to the documentation of this file.
1 /* PipeWire
2 * Copyright (C) 2015 Wim Taymans <wim.taymans@gmail.com>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20 #ifndef __PIPEWIRE_RTKIT_H__
21 #define __PIPEWIRE_RTKIT_H__
22
23 #include <sys/types.h>
24 #include <unistd.h>
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 #define RTKIT_SERVICE_NAME "org.freedesktop.RealtimeKit1"
31 #define RTKIT_OBJECT_PATH "/org/freedesktop/RealtimeKit1"
32
38 struct pw_rtkit_bus *
39 pw_rtkit_bus_get_system(void);
40
42 void
43 pw_rtkit_bus_free(struct pw_rtkit_bus *system_bus);
44
45
53 int
54 pw_rtkit_make_realtime(struct pw_rtkit_bus *system_bus, pid_t thread, int priority);
55
56
64 int
65 pw_rtkit_make_high_priority(struct pw_rtkit_bus *system_bus, pid_t thread, int nice_level);
66
71 int
72 pw_rtkit_get_max_realtime_priority(struct pw_rtkit_bus *system_bus);
73
79 int
80 pw_rtkit_get_min_nice_level(struct pw_rtkit_bus *system_bus, int *min_nice_level);
81
86 long long
87 pw_rtkit_get_rttime_usec_max(struct pw_rtkit_bus *system_bus);
88
89 #ifdef __cplusplus
90 }
91 #endif
92
93 #endif /* __PIPEWIRE_RTKIT_H__ */
pw_rtkit::pw_rtkit_make_realtime
int pw_rtkit_make_realtime(struct pw_rtkit_bus *system_bus, pid_t thread, int priority)
This is mostly equivalent to sched_setparam(thread, SCHED_RR, { .sched_priority = priority })...
Definition: rtkit.c:354
pw_rtkit::pw_rtkit_get_min_nice_level
int pw_rtkit_get_min_nice_level(struct pw_rtkit_bus *system_bus, int *min_nice_level)
Retreive the minimum value of nice level available.
Definition: rtkit.c:369
pw_rtkit::pw_rtkit_bus_free
void pw_rtkit_bus_free(struct pw_rtkit_bus *system_bus)
Free an RTKit bus.
Definition: rtkit.c:86
pw_rtkit::pw_rtkit_make_high_priority
int pw_rtkit_make_high_priority(struct pw_rtkit_bus *system_bus, pid_t thread, int nice_level)
This is mostly equivalent to setpriority(PRIO_PROCESS, thread, nice_level).
Definition: rtkit.c:359
pw_rtkit::pw_rtkit_get_max_realtime_priority
int pw_rtkit_get_max_realtime_priority(struct pw_rtkit_bus *system_bus)
Return the maximum value of realtime priority available.
Definition: rtkit.c:364
pw_rtkit::pw_rtkit_bus_get_system
struct pw_rtkit_bus * pw_rtkit_bus_get_system(void)
Get an RTKit bus.
Definition: rtkit.c:60
pw_rtkit::pw_rtkit_get_rttime_usec_max
long long pw_rtkit_get_rttime_usec_max(struct pw_rtkit_bus *system_bus)
Return the maximum value of RLIMIT_RTTIME to set before attempting a realtime request.
Definition: rtkit.c:374