VirtualBox

Changeset 101812 in vbox for trunk


Ignore:
Timestamp:
Nov 5, 2023 10:47:54 AM (16 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159908
Message:

libs/xpcom: Merge all the platform specific initialization routines into unix.c as they are pretty much empty now, bugref:10545

Location:
trunk/src/libs/xpcom18a4
Files:
6 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/Makefile.kmk

    r101809 r101812  
    559559endif
    560560
    561 VBox-xpcom-nspr_SOURCES.darwin  = nsprpub/pr/src/md/unix/darwin.c
    562 VBox-xpcom-nspr_SOURCES.freebsd = nsprpub/pr/src/md/unix/freebsd.c
    563 VBox-xpcom-nspr_SOURCES.linux   = nsprpub/pr/src/md/unix/linux.c
    564 VBox-xpcom-nspr_SOURCES.solaris = nsprpub/pr/src/md/unix/solaris.c
    565 
    566561$(call KB_FN_DO_PASS0_ON_TARGET,VBox-xpcom-nspr)
    567562
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/md/unix/unix.c

    r101805 r101812  
    5959#if defined(NTO)
    6060#include <sys/statvfs.h>
     61#endif
     62
     63#if defined(FREEBSD)
     64# include <signal.h>
    6165#endif
    6266
     
    11181122}
    11191123#endif /* _PR_NEED_FAKE_POLL */
     1124
     1125void _MD_EarlyInit(void)
     1126{
     1127#if defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD)
     1128    /*
     1129     * Ignore FPE because coercion of a NaN to an int causes SIGFPE
     1130     * to be raised.
     1131     */
     1132    struct sigaction act;
     1133
     1134    act.sa_handler = SIG_IGN;
     1135    sigemptyset(&act.sa_mask);
     1136    act.sa_flags = SA_RESTART;
     1137    sigaction(SIGFPE, &act, 0);
     1138#endif
     1139}
     1140
     1141#if defined(LINUX)
     1142extern void _MD_unix_terminate_waitpid_daemon(void);
     1143
     1144void _MD_CleanupBeforeExit(void)
     1145{
     1146    _MD_unix_terminate_waitpid_daemon();
     1147}
     1148#endif
     1149
     1150#if defined(SOLARIS)
     1151PRIntervalTime _MD_Solaris_TicksPerSecond(void)
     1152{
     1153    /*
     1154     * Ticks have a 10-microsecond resolution.  So there are
     1155     * 100000 ticks per second.
     1156     */
     1157    return 100000UL;
     1158}
     1159
     1160/* Interval timers, implemented using gethrtime() */
     1161
     1162PRIntervalTime _MD_Solaris_GetInterval(void)
     1163{
     1164    union {
     1165        hrtime_t hrt;  /* hrtime_t is a 64-bit (long long) integer */
     1166        PRInt64 pr64;
     1167    } time;
     1168    PRInt64 resolution;
     1169    PRIntervalTime ticks;
     1170
     1171    time.hrt = gethrtime();  /* in nanoseconds */
     1172    /*
     1173     * Convert from nanoseconds to ticks.  A tick's resolution is
     1174     * 10 microseconds, or 10000 nanoseconds.
     1175     */
     1176    LL_I2L(resolution, 10000);
     1177    LL_DIV(time.pr64, time.pr64, resolution);
     1178    LL_L2UI(ticks, time.pr64);
     1179    return ticks;
     1180}
     1181#endif
     1182
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette