diff options
author | Lennart Poettering <lennart@poettering.net> | 2006-07-20 01:25:37 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2006-07-20 01:25:37 +0000 |
commit | 2409f1a80b708ead6c48ebbb568bd2b7d6d3af31 (patch) | |
tree | 95dafb30d7febdf199b9fc0bc47090c8b06f5ad9 /src/daemon/daemon-conf.h | |
parent | 0ff247db7303d7c452d62bcfc1291075f297dcbd (diff) |
add support to set resource limits for the daemon and set some of them to some sane values
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1116 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/daemon/daemon-conf.h')
-rw-r--r-- | src/daemon/daemon-conf.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/daemon/daemon-conf.h b/src/daemon/daemon-conf.h index bfea7358..a09773f1 100644 --- a/src/daemon/daemon-conf.h +++ b/src/daemon/daemon-conf.h @@ -24,6 +24,10 @@ #include <pulsecore/log.h> +#ifdef HAVE_SYS_RESOURCE_H +#include <sys/resource.h> +#endif + /* The actual command to execute */ typedef enum pa_daemon_conf_cmd { PA_CMD_DAEMON, /* the default */ @@ -35,6 +39,13 @@ typedef enum pa_daemon_conf_cmd { PA_CMD_CHECK } pa_daemon_conf_cmd_t; +#ifdef HAVE_SYS_RESOURCE_H +typedef struct pa_rlimit { + rlim_t value; + int is_set; +} pa_rlimit; +#endif + /* A structure containing configuration data for the PulseAudio server . */ typedef struct pa_daemon_conf { pa_daemon_conf_cmd_t cmd; @@ -53,6 +64,17 @@ typedef struct pa_daemon_conf { pa_log_level_t log_level; int resample_method; char *config_file; + +#ifdef HAVE_SYS_RESOURCE_H + pa_rlimit rlimit_as, rlimit_core, rlimit_data, rlimit_fsize, rlimit_nofile, rlimit_stack; +#ifdef RLIMIT_NPROC + pa_rlimit rlimit_nproc; +#endif +#ifdef RLIMIT_MEMLOCK + pa_rlimit rlimit_memlock; +#endif +#endif + } pa_daemon_conf; /* Allocate a new structure and fill it with sane defaults */ |