return 0;
}
-static int parse_rlimit(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) {
#ifdef HAVE_SYS_RESOURCE_H
+static int parse_rlimit(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) {
struct pa_rlimit *r = data;
pa_assert(filename);
r->is_set = k >= 0;
r->value = k >= 0 ? (rlim_t) k : 0;
}
-#else
- pa_log_warn(_("[%s:%u] rlimit not supported on this platform."), filename, line);
-#endif
return 0;
}
+#endif
static int parse_sample_format(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) {
pa_daemon_conf *c = data;
return b;
}
+#ifdef _POSIX_PRIORITY_SCHEDULING
static int set_scheduler(int rtprio) {
#ifdef HAVE_SCHED_H
struct sched_param sp;
return -1;
}
+#endif
/* Make the current thread a realtime thread, and acquire the highest
* rtprio we can get that is less or equal the specified parameter. If
return -1;
}
+#ifdef HAVE_SYS_RESOURCE_H
static int set_nice(int nice_level) {
#ifdef HAVE_DBUS
DBusError error;
return -1;
}
+#endif
/* Raise the priority of the current process as much as possible that
* is <= the specified nice level..*/
return !pa_atomic_load(&m->bad);
}
+#ifdef HAVE_SIGACTION
static void sigsafe_error(const char *s) {
(void) write(STDERR_FILENO, s, strlen(s));
}
-#ifdef HAVE_SIGACTION
static void signal_handler(int sig, siginfo_t* si, void *data) {
unsigned j;
pa_memtrap *m;
#define SHM_MARKER_SIZE PA_ALIGN(sizeof(struct shm_marker))
+#ifdef HAVE_SHM_OPEN
static char *segment_name(char *fn, size_t l, unsigned id) {
pa_snprintf(fn, l, "/pulse-shm-%u", id);
return fn;
}
+#endif
int pa_shm_create_rw(pa_shm *m, size_t size, pa_bool_t shared, mode_t mode) {
char fn[32];
fprintf(stderr, " \r");
}
+#ifdef SIGUSR1
/* Someone requested that the latency is shown */
static void sigusr1_signal_callback(pa_mainloop_api*m, pa_signal_event *e, int sig, void *userdata) {
pa_operation_unref(pa_stream_update_timing_info(stream, stream_update_timing_callback, NULL));
}
+#endif
static void time_event_callback(pa_mainloop_api *m, pa_time_event *e, const struct timeval *t, void *userdata) {
if (stream && pa_stream_get_state(stream) == PA_STREAM_READY) {