~ampelbein/ubuntu/oneiric/heartbeat/lp-770743

« back to all changes in this revision

Viewing changes to include/clplumbing/realtime.h

  • Committer: Bazaar Package Importer
  • Author(s): Ante Karamatic
  • Date: 2010-02-17 21:59:18 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100217215918-06paxph5do4saw8v
Tags: 3.0.2-0ubuntu1
* New upstream release
* Drop hard dep on pacemaker for heartbet; moved to Recommends
* debian/heartbeat.install:
  - follow upstream changes
* debian/control:
  - added docbook-xsl and xsltproc to build depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
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.
6
 
 * 
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.
11
 
 * 
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
15
 
 */
16
 
 
17
 
#ifndef _CLPLUMBING_REALTIME_H
18
 
#       define _CLPLUMBING_REALTIME_H
19
 
#       include <sched.h>
20
 
 
21
 
/*
22
 
 *
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
25
 
 *
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.
29
 
 *
30
 
 * WARNING: badly behaved programs which use the make_realtime() function
31
 
 * can easily hang the machine.
32
 
 */
33
 
 
34
 
void cl_make_realtime
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 */
39
 
);
40
 
 
41
 
void cl_make_normaltime(void);
42
 
 
43
 
/* Cause calls to make_realtime() to be ignored */
44
 
void cl_disable_realtime(void);
45
 
 
46
 
/* Cause calls to make_realtime() to be accepted.
47
 
 * This is the default behaviour */
48
 
void cl_enable_realtime(void);
49
 
 
50
 
/* Sleep a really short (the shortest) time */
51
 
int cl_shortsleep(void);
52
 
 
53
 
/* Print messages if we've done (more) non-realtime mallocs */
54
 
void cl_realtime_malloc_check(void);
55
 
 
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);
60
 
 
61
 
#endif