summaryrefslogtreecommitdiffstats
path: root/src/daemon/daemon-conf.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-07-25 20:51:15 +0000
committerLennart Poettering <lennart@poettering.net>2006-07-25 20:51:15 +0000
commit61ce8bb0024764fa059aa5f5f1f5c2a0189c40bc (patch)
treee18a9c3aeba2c1c0775780562b2d061be760e96d /src/daemon/daemon-conf.c
parent563fab983f065fdad14696ce3f13d3df6a2b0370 (diff)
add new command line option --no-cpu-limit. This is useful when running PulseAudio in valgrind's massif or callgrind tools
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1149 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/daemon/daemon-conf.c')
-rw-r--r--src/daemon/daemon-conf.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index 0426989c..3e585d90 100644
--- a/src/daemon/daemon-conf.c
+++ b/src/daemon/daemon-conf.c
@@ -72,7 +72,8 @@ static const pa_daemon_conf default_conf = {
.resample_method = PA_RESAMPLER_SRC_SINC_FASTEST,
.config_file = NULL,
.use_pid_file = 1,
- .system_instance = 0
+ .system_instance = 0,
+ .no_cpu_limit = 0
#ifdef HAVE_SYS_RESOURCE_H
, .rlimit_as = { .value = 0, .is_set = 0 },
.rlimit_core = { .value = 0, .is_set = 0 },
@@ -246,6 +247,7 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) {
{ "resample-method", parse_resample_method, NULL },
{ "use-pid-file", pa_config_parse_bool, NULL },
{ "system-instance", pa_config_parse_bool, NULL },
+ { "no-cpu-limit", pa_config_parse_bool, NULL },
#ifdef HAVE_SYS_RESOURCE_H
{ "rlimit-as", parse_rlimit, NULL },
{ "rlimit-core", parse_rlimit, NULL },
@@ -278,21 +280,22 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) {
table[12].data = c;
table[13].data = &c->use_pid_file;
table[14].data = &c->system_instance;
+ table[15].data = &c->no_cpu_limit;
#ifdef HAVE_SYS_RESOURCE_H
- table[15].data = &c->rlimit_as;
- table[16].data = &c->rlimit_core;
- table[17].data = &c->rlimit_data;
- table[18].data = &c->rlimit_fsize;
- table[19].data = &c->rlimit_nofile;
- table[20].data = &c->rlimit_stack;
+ table[16].data = &c->rlimit_as;
+ table[17].data = &c->rlimit_core;
+ table[18].data = &c->rlimit_data;
+ table[19].data = &c->rlimit_fsize;
+ table[20].data = &c->rlimit_nofile;
+ table[21].data = &c->rlimit_stack;
#ifdef RLIMIT_NPROC
- table[21].data = &c->rlimit_nproc;
+ table[22].data = &c->rlimit_nproc;
#endif
#ifdef RLIMIT_MEMLOCK
#ifndef RLIMIT_NPROC
#error "Houston, we have a numbering problem!"
#endif
- table[22].data = &c->rlimit_memlock;
+ table[23].data = &c->rlimit_memlock;
#endif
#endif
@@ -363,6 +366,7 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) {
pa_strbuf_printf(s, "resample-method = %s\n", pa_resample_method_to_string(c->resample_method));
pa_strbuf_printf(s, "use-pid-file = %i\n", c->use_pid_file);
pa_strbuf_printf(s, "system-instance = %i\n", !!c->system_instance);
+ pa_strbuf_printf(s, "no-cpu-limit = %i\n", !!c->no_cpu_limit);
#ifdef HAVE_SYS_RESOURCE_H
pa_strbuf_printf(s, "rlimit-as = %li\n", c->rlimit_as.is_set ? (long int) c->rlimit_as.value : -1);
pa_strbuf_printf(s, "rlimit-core = %li\n", c->rlimit_core.is_set ? (long int) c->rlimit_core.value : -1);