Esempio n. 1
0
/**
* Get the destination for logging error reports. Env property OSPL_INFOFILE and
* OSPL_LOGPATH controls this value.
* If OSPL_INFOFILE is not set & this process is an OpenSplice service default
* to logging to a file named ospl-info.log, otherwise
* use standard out.
* @see os_report_file_path
*/
char *
os_reportGetInfoFileName()
{
    char* file_name;
    char procIdentity[256];
    static os_boolean doneOnce = OS_FALSE;

    os_reportInit(OS_FALSE);

    file_name = os_report_file_path ("ospl-info.log", (os_char *)os_env_infofile);
    /* @todo dds2881 - Uncomment below & remove above to enable application default error logging to stderr */
    /* file_name = os_report_file_path (os_procIsOpenSpliceService() ? "ospl-info.log" : "<stdout>", os_env_infofile);*/

    os_procFigureIdentity(procIdentity, sizeof (procIdentity)-1);
    procIdentity[sizeof (procIdentity)-1] = '\0';
    if (!doneOnce)
    {
        doneOnce = OS_TRUE;
        if (!doAppend)
        {
            os_remove (file_name);
        }
    }

    return file_name;
}
Esempio n. 2
0
/** \brief OS layer initialization
 *
 * \b os_osInit calls:
 * - \b os_sharedMemoryInit
 * - \b os_threadInit
 */
void os_osInit (void)
{
  os_uint32 initCount;

  initCount = pa_inc32_nv(&_ospl_osInitCount);

  if (initCount == 1) {
    os_mutexModuleInit();
    os_threadModuleInit();
    os_reportInit(OS_FALSE);
    /*os_processModuleInit();*/
#if ! LITE
    os_sharedMemoryInit();
#endif
  }

  return;
}
Esempio n. 3
0
/** \brief OS layer initialization
 *
 * \b os_osInit calls:
 * - \b os_sharedMemoryInit
 * - \b os_threadInit
 */
void
os_osInit (
    void)
{
    os_uint32 initCount;

    /* Sanity checks, don't remove, they don't generate any code anyway. */
    EXPRCHECK(sizeof(void *)==sizeof(os_os_uintptr))
    EXPRCHECK(sizeof(os_os_char)==1)
    EXPRCHECK(sizeof(os_os_uchar)==1)
    EXPRCHECK(sizeof(os_os_short)==2)
    EXPRCHECK(sizeof(os_os_ushort)==2)
    EXPRCHECK(sizeof(os_os_int32)==4)
    EXPRCHECK(sizeof(os_os_uint32)==4)
    EXPRCHECK(sizeof(os_os_int64)==8)
    EXPRCHECK(sizeof(os_os_uint64)==8)
    EXPRCHECK(sizeof(os_os_float)==4)
    EXPRCHECK(sizeof(os_os_double)==8)
    EXPRCHECK(sizeof(void *)==sizeof(os_os_address))
    EXPRCHECK(sizeof(void *)==sizeof(os_os_saddress))

    #if ! defined(__PPC) && ! defined(__x86_64__)
      /* Check for heap realignment code which relies */
      /* on types below being 32bit. */
       EXPRCHECK(sizeof(size_t)==4)
       EXPRCHECK(sizeof(void *)==4)
    #endif

    initCount = pa_inc32_nv(&_ospl_osInitCount);

    if (initCount == 1) {
        /* init for programs using data base threads */
        os_threadModuleInit();
        os_reportInit(OS_FALSE);
        os_procInitialize();
        os_stdlibInitialize();
        os_sharedMemoryInit();
    } else {
        os_procInitialize();
    }
    return;
}
Esempio n. 4
0
/** \brief OS layer initialization
 *
 * \b os_osInit calls:
 * - \b os_sharedMemoryInit
 * - \b os_threadInit
 */
void os_osInit (void)
{
  os_uint32 initCount;

  initCount = pa_increment(&_ospl_osInitCount);

  if (initCount == 1) {
    os_mutexModuleInit();
    os_reportInit(OS_FALSE);
    /*os_processModuleInit();*/
    os_threadModuleInit();
    os_sharedMemoryInit();
  } else {
#ifndef NDEBUG
    OS_REPORT_1(OS_INFO, "os_osInit", 1,
                "OS-layer initialization called %d times", initCount);
#endif /* NDEBUG */
  }
  return;
}