Changeset 537 in vbox for trunk/src/VBox/Runtime/r3/posix
- Timestamp:
- Feb 2, 2007 6:08:57 AM (18 years ago)
- Location:
- trunk/src/VBox/Runtime/r3/posix
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/path-posix.cpp
r1 r537 332 332 */ 333 333 /** @todo use RTProcGetExecutableName() */ 334 #ifdef __LINUX__ 334 #if defined(__LINUX__) || defined(__FREEBSD__) 335 # ifdef __LINUX__ 335 336 int cchLink = readlink("/proc/self/exe", &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1); 337 # else 338 int cchLink = readlink("/proc/curproc/file", &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1); 339 # endif 336 340 if (cchLink < 0 || cchLink == sizeof(g_szrtProgramPath) - 1) 337 341 { -
trunk/src/VBox/Runtime/r3/posix/process-posix.cpp
r1 r537 31 31 #include <sys/stat.h> 32 32 #include <sys/wait.h> 33 #include <signal.h> 33 34 #if defined(__LINUX__) || defined(__OS2__) 34 35 # define HAVE_POSIX_SPAWN 1 … … 235 236 * because I'm lazy I'm not creating OS specific code 236 237 * files and code for this. 237 */ 238 #ifdef __LINUX__ 238 */ 239 #if defined(__LINUX__) || defined(__FREEBSD__) 240 # ifdef __LINUX__ 239 241 int cchLink = readlink("/proc/self/exe", pszExecName, cchExecName - 1); 242 # else 243 int cchLink = readlink("/proc/curproc/file", pszExecName, cchExecName - 1); 244 # endif 240 245 if (cchLink > 0 && (size_t)cchLink <= cchExecName - 1) 241 246 { -
trunk/src/VBox/Runtime/r3/posix/system-posix.cpp
r1 r537 38 38 RTR3DECL(unsigned) RTSystemProcessorGetCount(void) 39 39 { 40 int cCpus; NOREF(cCpus); 41 40 42 /* 41 43 * The sysconf way (linux and others). 42 44 */ 43 45 #ifdef _SC_NPROCESSORS_ONLN 44 intcCpus = sysconf(_SC_NPROCESSORS_ONLN);46 cCpus = sysconf(_SC_NPROCESSORS_ONLN); 45 47 if (cCpus >= 1) 46 48 return cCpus; … … 54 56 aiMib[0] = CTL_HW; 55 57 aiMib[1] = HW_NCPU; 56 intcCpus = -1;58 cCpus = -1; 57 59 size_t cb = sizeof(cCpus); 58 60 int rc = sysctl(aiMib, ELEMENTS(aiMib), &cCpus, &cb, NULL, 0); -
trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp
r248 r537 200 200 if (!cMillies) 201 201 { 202 /* pthread_yield() isn't part of SuS, thus this fun. */ 202 203 #ifdef __DARWIN__ 203 204 pthread_yield_np(); 205 #elif defined(__FREEBSD__) /* void pthread_yield */ 206 pthread_yield(); 204 207 #else 205 208 if (!pthread_yield()) -
trunk/src/VBox/Runtime/r3/posix/timer-posix.cpp
r197 r537 38 38 #include <sys/ioctl.h> 39 39 #ifdef __LINUX__ 40 # include <linux/rtc.h>40 # include <linux/rtc.h> 41 41 #endif 42 42 #include <sys/time.h> … … 44 44 #include <errno.h> 45 45 #ifndef __OS2__ 46 # include <pthread.h>46 # include <pthread.h> 47 47 #endif 48 48 … … 224 224 * Block SIGALRM from calling thread. 225 225 */ 226 #if defined(__FREEBSD__) /* sighold is missing and I don't wish to break anything atm. */ 227 sigset_t SigSet; 228 sigemptyset(&SigSet); 229 sigaddset(&SigSet, SIGALRM); 230 sigprocmask(SIG_BLOCK, &SigSet, NULL); 231 #else 226 232 sighold(SIGALRM); 233 #endif 227 234 static bool fDoneRTC; 228 235 if (!fDoneRTC)
Note:
See TracChangeset
for help on using the changeset viewer.