Changeset 101877 in vbox for trunk/src/libs/xpcom18a4/nsprpub
- Timestamp:
- Nov 6, 2023 3:25:18 PM (15 months ago)
- Location:
- trunk/src/libs/xpcom18a4/nsprpub/pr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/pprthred.h
r101776 r101877 84 84 #define PR_OS2_SetFloatExcpHandler VBoxNsprPR_OS2_SetFloatExcpHandler 85 85 #define PR_OS2_UnsetFloatExcpHandler VBoxNsprPR_OS2_UnsetFloatExcpHandler 86 #define PR_XLock VBoxNsprPR_XLock87 #define PR_XUnlock VBoxNsprPR_XUnlock88 #define PR_XIsLocked VBoxNsprPR_XIsLocked89 #define PR_XWait VBoxNsprPR_XWait90 #define PR_XNotify VBoxNsprPR_XNotify91 #define PR_XNotifyAll VBoxNsprPR_XNotifyAll92 86 #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */ 93 87 … … 311 305 #define PR_InMonitor(m) (PR_GetMonitorEntryCount(m) > 0) 312 306 313 /*---------------------------------------------------------------------------314 ** Special X-Lock hack for client315 ---------------------------------------------------------------------------*/316 317 #ifdef XP_UNIX318 extern void PR_XLock(void);319 extern void PR_XUnlock(void);320 extern PRBool PR_XIsLocked(void);321 #endif /* XP_UNIX */322 323 307 PR_END_EXTERN_C 324 308 -
trunk/src/libs/xpcom18a4/nsprpub/pr/src/md/unix/unix.c
r101874 r101877 95 95 */ 96 96 static PRLock *_pr_rename_lock = NULL; 97 static PRMonitor *_pr_Xfe_mon = NULL;98 97 99 98 static PRInt64 minus_one; … … 468 467 */ 469 468 470 #if defined(SOLARIS2_5) 471 472 static PRIntn _MD_solaris25_fstat64(PRIntn osfd, _MDStat64 *buf) 473 { 474 PRInt32 rv; 475 struct stat sb; 476 477 rv = fstat(osfd, &sb); 478 if (rv >= 0) 479 { 480 /* 481 ** I'm only copying the fields that are immediately needed. 482 ** If somebody else calls this function, some of the fields 483 ** may not be defined. 484 */ 485 (void)memset(buf, 0, sizeof(_MDStat64)); 486 buf->st_mode = sb.st_mode; 487 buf->st_ctim = sb.st_ctim; 488 buf->st_mtim = sb.st_mtim; 489 buf->st_size = sb.st_size; 490 } 491 return rv; 492 } /* _MD_solaris25_fstat64 */ 493 494 static PRIntn _MD_solaris25_stat64(const char *fn, _MDStat64 *buf) 495 { 496 PRInt32 rv; 497 struct stat sb; 498 499 rv = stat(fn, &sb); 500 if (rv >= 0) 501 { 502 /* 503 ** I'm only copying the fields that are immediately needed. 504 ** If somebody else calls this function, some of the fields 505 ** may not be defined. 506 */ 507 (void)memset(buf, 0, sizeof(_MDStat64)); 508 buf->st_mode = sb.st_mode; 509 buf->st_ctim = sb.st_ctim; 510 buf->st_mtim = sb.st_mtim; 511 buf->st_size = sb.st_size; 512 } 513 return rv; 514 } /* _MD_solaris25_stat64 */ 515 #endif /* defined(SOLARIS2_5) */ 516 517 #if defined(_PR_NO_LARGE_FILES) || defined(SOLARIS2_5) 469 #if defined(_PR_NO_LARGE_FILES) 518 470 519 471 static PROffset64 _MD_Unix_lseek64(PRIntn osfd, PROffset64 offset, PRIntn whence) … … 539 491 return NULL; 540 492 } /* _MD_Unix_mmap64 */ 541 #endif /* defined(_PR_NO_LARGE_FILES) || defined(SOLARIS2_5) */ 542 543 #if defined(OSF1) && defined(__GNUC__) 544 545 /* 546 * On OSF1 V5.0A, <sys/stat.h> defines stat and fstat as 547 * macros when compiled under gcc, so it is rather tricky to 548 * take the addresses of the real functions the macros expend 549 * to. A simple solution is to define forwarder functions 550 * and take the addresses of the forwarder functions instead. 551 */ 552 553 static int stat_forwarder(const char *path, struct stat *buffer) 554 { 555 return stat(path, buffer); 556 } 557 558 static int fstat_forwarder(int filedes, struct stat *buffer) 559 { 560 return fstat(filedes, buffer); 561 } 562 563 #endif 493 #endif /* defined(_PR_NO_LARGE_FILES) */ 564 494 565 495 static void _PR_InitIOV(void) 566 496 { 567 #if defined(SOLARIS2_5) 568 PRLibrary *lib; 569 void *open64_func; 570 571 open64_func = PR_FindSymbolAndLibrary("open64", &lib); 572 if (NULL != open64_func) 573 { 574 PR_ASSERT(NULL != lib); 575 _md_iovector._open64 = (_MD_Open64)open64_func; 576 _md_iovector._mmap64 = (_MD_Mmap64)PR_FindSymbol(lib, "mmap64"); 577 _md_iovector._fstat64 = (_MD_Fstat64)PR_FindSymbol(lib, "fstat64"); 578 _md_iovector._stat64 = (_MD_Stat64)PR_FindSymbol(lib, "stat64"); 579 _md_iovector._lseek64 = (_MD_Lseek64)PR_FindSymbol(lib, "lseek64"); 580 (void)PR_UnloadLibrary(lib); 581 } 582 else 583 { 584 _md_iovector._open64 = open; 585 _md_iovector._mmap64 = _MD_Unix_mmap64; 586 _md_iovector._fstat64 = _MD_solaris25_fstat64; 587 _md_iovector._stat64 = _MD_solaris25_stat64; 588 _md_iovector._lseek64 = _MD_Unix_lseek64; 589 } 590 #elif defined(_PR_NO_LARGE_FILES) 497 #if defined(_PR_NO_LARGE_FILES) 591 498 _md_iovector._open64 = open; 592 499 _md_iovector._mmap64 = _MD_Unix_mmap64; … … 595 502 _md_iovector._lseek64 = _MD_Unix_lseek64; 596 503 #elif defined(_PR_HAVE_OFF64_T) 597 #if defined(IRIX5_3)598 _md_iovector._open64 = open;599 #else600 504 _md_iovector._open64 = open64; 601 #endif602 505 _md_iovector._mmap64 = mmap64; 603 506 _md_iovector._fstat64 = fstat64; … … 607 510 _md_iovector._open64 = open; 608 511 _md_iovector._mmap64 = mmap; 609 #if defined(OSF1) && defined(__GNUC__)610 _md_iovector._fstat64 = fstat_forwarder;611 _md_iovector._stat64 = stat_forwarder;612 #else613 512 _md_iovector._fstat64 = fstat; 614 513 _md_iovector._stat64 = stat; 615 #endif616 514 _md_iovector._lseek64 = lseek; 617 515 #else … … 636 534 _pr_rename_lock = PR_NewLock(); 637 535 PR_ASSERT(NULL != _pr_rename_lock); 638 _pr_Xfe_mon = PR_NewMonitor();639 PR_ASSERT(NULL != _pr_Xfe_mon);640 #ifdef VBOX641 RTMEM_MAY_LEAK(_pr_rename_lock);642 RTMEM_MAY_LEAK(_pr_Xfe_mon);643 #endif644 536 645 537 _PR_InitIOV(); /* one last hack */ … … 711 603 712 604 /************************************************************************/ 713 714 /*715 ** Special hacks for xlib. Xlib/Xt/Xm is not re-entrant nor is it thread716 ** safe. Unfortunately, neither is mozilla. To make these programs work717 ** in a pre-emptive threaded environment, we need to use a lock.718 */719 720 void PR_XLock(void)721 {722 PR_EnterMonitor(_pr_Xfe_mon);723 }724 725 void PR_XUnlock(void)726 {727 PR_ExitMonitor(_pr_Xfe_mon);728 }729 730 PRBool PR_XIsLocked(void)731 {732 return (PR_InMonitor(_pr_Xfe_mon)) ? PR_TRUE : PR_FALSE;733 }734 735 void PR_XWait(int ms)736 {737 PR_Wait(_pr_Xfe_mon, PR_MillisecondsToInterval(ms));738 }739 740 void PR_XNotify(void)741 {742 PR_Notify(_pr_Xfe_mon);743 }744 745 void PR_XNotifyAll(void)746 {747 PR_NotifyAll(_pr_Xfe_mon);748 }749 605 750 606 PR_IMPLEMENT(PRStatus) _MD_gethostname(char *name, PRUint32 namelen)
Note:
See TracChangeset
for help on using the changeset viewer.