From 0329edd1791e3c8fbed33f266d86cae6b91a5556 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Thu, 26 Feb 2009 16:48:58 +1100 Subject: revive solaris module Hi All, This patch fixes the solaris audio device source and sink, and fixes some portability issues that break the build on solaris. Questions and comments welcomed. I've tested this patch only with OpenSolaris Express snv 103. Eventually I hope to be able to test a few older releases and older hardware (though it is hard to say whether there is much interest in those). This is my first brush with pulseaudio and so I read the wiki docs and some of the source code but I'm still unsure of a few things. In particular I'm wondering about rewind processing, corking and what (if anything) the module needs for those. I'm also unclear on the implications of thread_info.buffer_size, .fragment_size and .max_request, and whether my code is correct or not. This patch disables link map/library versioning unless ld is GNU ld. Another approach for solaris would be to use that linker's -M option, but I couldn't make that work (due to undefined mainloop, browse and simple symbols when linking pacat. I can post the errors if anyone is intested.) Thanks, Finn Thain --- src/daemon/daemon-conf.c | 10 ++++++++-- src/daemon/daemon-conf.h | 6 ++++-- src/daemon/main.c | 2 ++ 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src/daemon') diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index b02377ab..ac6cc8aa 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -94,8 +94,10 @@ static const pa_daemon_conf default_conf = { ,.rlimit_fsize = { .value = 0, .is_set = FALSE }, .rlimit_data = { .value = 0, .is_set = FALSE }, .rlimit_stack = { .value = 0, .is_set = FALSE }, - .rlimit_core = { .value = 0, .is_set = FALSE }, - .rlimit_rss = { .value = 0, .is_set = FALSE } + .rlimit_core = { .value = 0, .is_set = FALSE } +#ifdef RLIMIT_RSS + ,.rlimit_rss = { .value = 0, .is_set = FALSE } +#endif #ifdef RLIMIT_NPROC ,.rlimit_nproc = { .value = 0, .is_set = FALSE } #endif @@ -472,7 +474,9 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) { { "rlimit-data", parse_rlimit, &c->rlimit_data, NULL }, { "rlimit-stack", parse_rlimit, &c->rlimit_stack, NULL }, { "rlimit-core", parse_rlimit, &c->rlimit_core, NULL }, +#ifdef RLIMIT_RSS { "rlimit-rss", parse_rlimit, &c->rlimit_rss, NULL }, +#endif #ifdef RLIMIT_NOFILE { "rlimit-nofile", parse_rlimit, &c->rlimit_nofile, NULL }, #endif @@ -651,7 +655,9 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) { pa_strbuf_printf(s, "rlimit-data = %li\n", c->rlimit_data.is_set ? (long int) c->rlimit_data.value : -1); pa_strbuf_printf(s, "rlimit-stack = %li\n", c->rlimit_stack.is_set ? (long int) c->rlimit_stack.value : -1); pa_strbuf_printf(s, "rlimit-core = %li\n", c->rlimit_core.is_set ? (long int) c->rlimit_core.value : -1); +#ifdef RLIMIT_RSS pa_strbuf_printf(s, "rlimit-rss = %li\n", c->rlimit_rss.is_set ? (long int) c->rlimit_rss.value : -1); +#endif #ifdef RLIMIT_AS pa_strbuf_printf(s, "rlimit-as = %li\n", c->rlimit_as.is_set ? (long int) c->rlimit_as.value : -1); #endif diff --git a/src/daemon/daemon-conf.h b/src/daemon/daemon-conf.h index 787676c7..9cec189f 100644 --- a/src/daemon/daemon-conf.h +++ b/src/daemon/daemon-conf.h @@ -87,8 +87,10 @@ typedef struct pa_daemon_conf { char *config_file; #ifdef HAVE_SYS_RESOURCE_H - pa_rlimit rlimit_fsize, rlimit_data, rlimit_stack, rlimit_core, rlimit_rss; - + pa_rlimit rlimit_fsize, rlimit_data, rlimit_stack, rlimit_core; +#ifdef RLIMIT_RSS + pa_rlimit rlimit_rss; +#endif #ifdef RLIMIT_NOFILE pa_rlimit rlimit_nofile; #endif diff --git a/src/daemon/main.c b/src/daemon/main.c index 46a279d0..0048e7b7 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -294,7 +294,9 @@ static void set_all_rlimits(const pa_daemon_conf *conf) { set_one_rlimit(&conf->rlimit_data, RLIMIT_DATA, "RLIMIT_DATA"); set_one_rlimit(&conf->rlimit_stack, RLIMIT_STACK, "RLIMIT_STACK"); set_one_rlimit(&conf->rlimit_core, RLIMIT_CORE, "RLIMIT_CORE"); +#ifdef RLIMIT_RSS set_one_rlimit(&conf->rlimit_rss, RLIMIT_RSS, "RLIMIT_RSS"); +#endif #ifdef RLIMIT_NPROC set_one_rlimit(&conf->rlimit_nproc, RLIMIT_NPROC, "RLIMIT_NPROC"); #endif -- cgit