diff options
Diffstat (limited to 'audio/csound-dev/patches/patch-ae')
-rw-r--r-- | audio/csound-dev/patches/patch-ae | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/audio/csound-dev/patches/patch-ae b/audio/csound-dev/patches/patch-ae new file mode 100644 index 00000000000..c6146a9a920 --- /dev/null +++ b/audio/csound-dev/patches/patch-ae @@ -0,0 +1,72 @@ +$NetBSD: patch-ae,v 1.1 2003/12/13 20:26:03 ben Exp $ + +--- csmain.c.orig 2003-02-25 19:24:01.000000000 -0800 ++++ csmain.c +@@ -51,18 +51,26 @@ extern void init_pvsys(void); + + #include <signal.h> + +-#if defined(LINUX) ++#if defined(LINUX) || defined(__NetBSD__) + + #include <unistd.h> /* Linux real-time by Istvan Varga, Jan 2002 */ + #include <sys/types.h> + #include <errno.h> ++#ifdef BSD ++#include <sys/time.h> ++#include <sys/resource.h> ++#define HIGH_PRIORITY -20 ++#else + #include <sched.h> ++#endif + #include <sys/mman.h> + + void set_rt_priority(int argc, char **argv) + { + int rtmode; ++#ifndef __NetBSD__ + struct sched_param p; ++#endif + int i; + + if (geteuid() != 0) return; /* not root, nothing to do */ +@@ -95,7 +103,7 @@ void set_rt_priority(int argc, char **ar + return; + } + +-#ifndef __FreeBSD__ ++#if !defined(__FreeBSD__) && !defined(__NetBSD__) + /* lock all pages into physical memory */ + if (mlockall(MCL_CURRENT | MCL_FUTURE) != 0) { + fprintf(stderr, "csound: cannot lock memory pages: %s\n", +@@ -104,6 +112,14 @@ void set_rt_priority(int argc, char **ar + } + #endif + ++#ifdef __NetBSD__ ++ if (setpriority(PRIO_PROCESS, 0, HIGH_PRIORITY) == 0) ++ fprintf(stderr, "csound: scheduler priority %i...\n", HIGH_PRIORITY); ++ else ++ fprintf(stderr, "csound: scheduler priority %i failed: %s\n", ++ HIGH_PRIORITY, strerror(errno)); ++ fflush(stderr); ++#else + /* set round robin mode with max. priority */ + p.sched_priority = sched_get_priority_max(SCHED_RR); + if (sched_setscheduler(0, SCHED_RR, &p) != 0) { +@@ -111,13 +127,14 @@ void set_rt_priority(int argc, char **ar + strerror(errno)); + exit(-1); + } ++#endif + /* give up root permissions */ + setuid(getuid()); + } + + #endif + +-#if !defined(LINUX) && !defined(SGI) && !defined(__BEOS__) && !defined(MACOSX) ++#if !defined(LINUX) && !defined(SGI) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__NetBSD__) + static char *signal_to_string(int sig) + { + switch(sig) { |