Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 218239 Details for
Bug 303289
dev-perl/Sys-CPU FreeBSD patch
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to make Sys-CPU-0.51 run on FreeBSD
Sys-CPU-0.51-fbsd.patch (text/plain), 1.44 KB, created by
Johan Hattne
on 2010-02-03 00:01:18 UTC
(
hide
)
Description:
Patch to make Sys-CPU-0.51 run on FreeBSD
Filename:
MIME Type:
Creator:
Johan Hattne
Created:
2010-02-03 00:01:18 UTC
Size:
1.44 KB
patch
obsolete
>--- CPU.xs.orig 2010-02-01 13:07:41 -0600 >+++ CPU.xs 2010-02-01 13:11:57 -0600 >@@ -40,6 +40,12 @@ > #define _have_cpu_clock > #define _have_cpu_type > #endif >+#ifdef __FreeBSD__ >+ #include <sys/sysctl.h> >+ #define _have_cpu_clock >+ #define _have_cpu_type >+#endif >+ > #ifdef WINDOWS > /* Registry Functions */ > >@@ -271,6 +277,30 @@ > > #endif > >+#ifdef __FreeBSD__ >+int >+fbsd_get_cpu_clock() >+{ >+ size_t len; >+ int clockrate; >+ >+ len = sizeof(clockrate); >+ if (sysctlbyname("hw.clockrate", &clockrate, &len, NULL, 0) != 0) >+ return (0); >+ return (clockrate); >+} >+ >+int >+fbsd_get_type_name(char *name, size_t len) >+{ >+ int mib[2]; >+ >+ mib[0] = CTL_HW; >+ mib[1] = HW_MODEL; >+ return (sysctl(mib, 2, name, &len, NULL, 0)); >+} >+#endif >+ > int get_cpu_count() { > int ret; > char buffer[255]; >@@ -334,6 +373,9 @@ > #ifdef __APPLE__ > clock = CurrentProcessorSpeed(); > #endif >+#ifdef __FreeBSD__ >+ clock = fbsd_get_cpu_clock(); >+#endif > #ifndef _have_cpu_clock > processor_info_t info, *infop=&info; > if ( processor_info(0, infop) == 0 && infop->pi_state == P_ONLINE) { >@@ -372,6 +414,9 @@ > #ifdef __APPLE__ > value = apple_get_type_name(); > #endif >+#ifdef __FreeBSD__ >+ fbsd_get_type_name(value, MAX_IDENT_SIZE); >+#endif > #ifndef _have_cpu_type /* not linux, not windows */ > processor_info_t info, *infop=&info; > if (processor_info (0, infop)==0) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 303289
: 218239