2
* This library is free software; you can redistribute it and/or
3
* modify it under the terms of the GNU Lesser General Public
4
* License as published by the Free Software Foundation; either
5
* version 2.1 of the License, or (at your option) any later version.
7
* This library is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10
* Lesser General Public License for more details.
12
* You should have received a copy of the GNU Lesser General Public
13
* License along with this library; if not, write to the Free Software
14
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
#ifndef _CLPLUMBING_REALTIME_H
18
# define _CLPLUMBING_REALTIME_H
23
* make_realtime() will make the current process a soft realtime process
24
* and lock it into memory after growing the heap by heapgrowK*1024 bytes
26
* If you set spolicy or priority to <= 0, then defaults will be used.
27
* Otherwise you need to use a value for spolicy from <sched.h>
28
* and use an appropriate priority for the given spolicy.
30
* WARNING: badly behaved programs which use the make_realtime() function
31
* can easily hang the machine.
35
( int spolicy, /* SCHED_RR or SCHED_FIFO (or SCHED_OTHER) */
36
int priority, /* typically 1-99 */
37
int stackgrowK, /* Amount to grow stack by */
38
int heapgrowK /* Amount to grow heap by */
41
void cl_make_normaltime(void);
43
/* Cause calls to make_realtime() to be ignored */
44
void cl_disable_realtime(void);
46
/* Cause calls to make_realtime() to be accepted.
47
* This is the default behaviour */
48
void cl_enable_realtime(void);
50
/* Sleep a really short (the shortest) time */
51
int cl_shortsleep(void);
53
/* Print messages if we've done (more) non-realtime mallocs */
54
void cl_realtime_malloc_check(void);
56
/* Number of times we "go to the well" for memory after becoming realtime */
57
int cl_nonrealtime_malloc_count(void);
58
/* Number of bytes we "got from the well" for memory after becoming realtime */
59
unsigned long cl_nonrealtime_malloc_size(void);