summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authoreddyg <[email protected]>2007-10-11 19:46:43 +0000
committereddyg <[email protected]>2007-10-11 19:46:43 +0000
commit82d12896b6f48d7049aee762ddd59e61499caf9c (patch)
tree9730a81a25d91fe942d70bc12ad3fde0de754bbb /libhb
parent0f0738745170bd3fdd56c0580a164e50b515c12d (diff)
Port HandBrake to Solaris, most of the heavy lifting provided by begi.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1019 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/ports.c20
-rw-r--r--libhb/ports.h2
2 files changed, 20 insertions, 2 deletions
diff --git a/libhb/ports.c b/libhb/ports.c
index 18304d17f..27879ddcc 100644
--- a/libhb/ports.c
+++ b/libhb/ports.c
@@ -12,6 +12,8 @@
#include <signal.h>
#elif defined( SYS_CYGWIN )
#include <windows.h>
+#elif defined( SYS_SunOS )
+#include <sys/processor.h>
#endif
#if USE_PTHREAD
@@ -74,7 +76,7 @@ void hb_snooze( int delay )
}
#if defined( SYS_BEOS )
snooze( 1000 * delay );
-#elif defined( SYS_DARWIN ) || defined( SYS_LINUX ) || defined( SYS_FREEBSD )
+#elif defined( SYS_DARWIN ) || defined( SYS_LINUX ) || defined( SYS_FREEBSD) || defined( SYS_SunOS )
usleep( 1000 * delay );
#elif defined( SYS_CYGWIN )
Sleep( delay );
@@ -146,6 +148,22 @@ int hb_get_cpu_count()
SYSTEM_INFO cpuinfo;
GetSystemInfo( &cpuinfo );
cpu_count = cpuinfo.dwNumberOfProcessors;
+#elif defined( SYS_SunOS )
+ {
+ processorid_t cpumax;
+ int i,j=0;
+
+ cpumax = sysconf(_SC_CPUID_MAX);
+
+ for(i = 0; i <= cpumax; i++ )
+ {
+ if(p_online(i, P_STATUS) != -1)
+ {
+ j++;
+ }
+ }
+ cpu_count=j;
+ }
#endif
cpu_count = MAX( 1, cpu_count );
diff --git a/libhb/ports.h b/libhb/ports.h
index 47df1ce5e..ce9441a1c 100644
--- a/libhb/ports.h
+++ b/libhb/ports.h
@@ -37,7 +37,7 @@ typedef struct hb_thread_s hb_thread_t;
#elif defined( SYS_DARWIN )
# define HB_LOW_PRIORITY 0
# define HB_NORMAL_PRIORITY 31
-#elif defined( SYS_LINUX ) || defined( SYS_FREEBSD )
+#elif defined( SYS_LINUX ) || defined( SYS_FREEBSD ) || defined ( SYS_SunOS )
# define HB_LOW_PRIORITY 0
# define HB_NORMAL_PRIORITY 0
#elif defined( SYS_CYGWIN )