From 72019c94df1af052eed7f4523209e7d8aaa6dbda Mon Sep 17 00:00:00 2001 From: Steve Price Date: Fri, 2 Apr 1999 03:52:55 +0000 Subject: Update to version 0.5.0. PR: 10781 Submitted by: Chris Piazza --- audio/gqmpeg/files/patch-ab | 75 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 audio/gqmpeg/files/patch-ab (limited to 'audio/gqmpeg/files/patch-ab') diff --git a/audio/gqmpeg/files/patch-ab b/audio/gqmpeg/files/patch-ab new file mode 100644 index 000000000000..9a8d2a1fd11d --- /dev/null +++ b/audio/gqmpeg/files/patch-ab @@ -0,0 +1,75 @@ +--- main.c.orig Tue Mar 30 01:40:15 1999 ++++ main.c Tue Mar 30 01:47:25 1999 +@@ -15,6 +15,27 @@ + #include + #include + ++#ifdef __FreeBSD__ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef FSCALE ++#define FIXED_PCTCPU FSCALE ++#endif ++ ++#ifdef FIXED_PCTCPU ++typedef long pctcpu; ++#define pctdouble(p) ((double)(p) / FIXED_PCTCPU) ++#else ++typedef double pctcpu; ++#define pctdouble(p) (p) ++#endif ++#endif ++ + static gint fast_advance = FALSE; + static gint advance_max_frame; + static gint advance_max_sec; +@@ -99,6 +120,36 @@ + #define HZ 100 /* for FreeBSD? */ + #endif + ++#ifdef __FreeBSD__ ++static gfloat check_child_cpu_usage(int childs_pid) ++{ ++ static gfloat percent_of_cpu = 0.0; ++ ++ static kvm_t *kd; ++ kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open"); ++ if (kd == NULL) return percent_of_cpu; ++ ++ { ++ static struct kinfo_proc *ki; ++ static int nproc; ++ ki = kvm_getprocs(kd, KERN_PROC_PID, childs_pid, &nproc); ++ if (nproc != 1) { ++ percent_of_cpu = 0.0; ++ } else { ++ percent_of_cpu = 100.0 * pctdouble(ki->kp_proc.p_pctcpu); ++ } ++ } ++ ++ kvm_close(kd); ++ ++ if (percent_of_cpu > 99.0) { ++ percent_of_cpu = 99; ++ } ++ ++ return percent_of_cpu; ++} ++ ++#else + static gfloat check_child_cpu_usage(int childs_pid) + { + /* needed for SGI IRIX 5.3 and 6.5 */ +@@ -197,6 +248,7 @@ + + return percent_of_cpu; + } ++#endif + + void set_song_info(gint n) + { -- cgit v1.2.3