VirtualBox

Changeset 43363 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Sep 20, 2012 9:56:07 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
80827
Message:

Haiku Additions.

Location:
trunk/src/VBox/Runtime
Files:
21 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/VBox/log-vbox.cpp

    r40938 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    138138#  include <stdlib.h>
    139139#  include <unistd.h>
     140# elif defined(RT_OS_HAIKU)
     141#  include <OS.h>
    140142# elif defined(RT_OS_SOLARIS)
    141143#  define _STRUCTURED_PROC 1
     
    369371        }
    370372
     373#  elif defined(RT_OS_HAIKU)
     374        team_info info;
     375        if (get_team_info(0, &info) == B_OK)
     376        {
     377                /* there is an info.argc, but no way to know arg boundaries */
     378            RTLogLoggerEx(pLogger, 0, ~0U, "Commandline: %.64s\n", info.args);
     379        }
     380
    371381#  elif defined(RT_OS_FREEBSD)
    372382        /* Retrieve the required length first */
  • trunk/src/VBox/Runtime/common/err/RTErrConvertFromErrno.cpp

    r40824 r43363  
    431431#endif
    432432#ifdef EDOOFUS
     433# if EDOOFUS != EINVAL
    433434        case EDOOFUS:           return VERR_INTERNAL_ERROR;
     435# endif
    434436#endif
    435437#ifdef ENOTSUP
  • trunk/src/VBox/Runtime/r3/posix/RTHandleGetStandard-posix.cpp

    r33973 r43363  
    55
    66/*
    7  * Copyright (C) 2010 Oracle Corporation
     7 * Copyright (C) 2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3333#include <sys/types.h>
    3434#include <sys/ioctl.h>
    35 #include <sys/fcntl.h>
    3635#include <fcntl.h>
    3736#ifdef _MSC_VER
  • trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp

    r39627 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3434#include <sys/types.h>
    3535#include <sys/stat.h>
    36 #include <sys/fcntl.h>
    3736#include <fcntl.h>
    3837#include <dirent.h>
     
    5453#include "internal/path.h"
    5554
    56 #if !defined(RT_OS_SOLARIS)
     55#if !defined(RT_OS_SOLARIS) && !defined(RT_OS_HAIKU)
    5756# define HAVE_DIRENT_D_TYPE 1
    5857#endif
  • trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp

    r39627 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3535#include <sys/types.h>
    3636#include <sys/ioctl.h>
    37 #include <sys/fcntl.h>
    3837#include <fcntl.h>
    3938#ifdef _MSC_VER
  • trunk/src/VBox/Runtime/r3/posix/fileio2-posix.cpp

    r40553 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5757#endif
    5858
     59#ifdef RT_OS_HAIKU
     60# define USE_FUTIMENS
     61#endif
     62
    5963#include <iprt/file.h>
    6064#include <iprt/path.h>
     
    144148        return VINF_SUCCESS;
    145149
     150#ifdef USE_FUTIMENS
     151    struct timespec aTimespecs[2];
     152    if (pAccessTime && pModificationTime)
     153    {
     154        memcpy(&aTimespecs[0], pAccessTime, sizeof(struct timespec));
     155        memcpy(&aTimespecs[1], pModificationTime, sizeof(struct timespec));
     156    }
     157    else
     158    {
     159        RTFSOBJINFO ObjInfo;
     160        int rc = RTFileQueryInfo(hFile, &ObjInfo, RTFSOBJATTRADD_UNIX);
     161        if (RT_FAILURE(rc))
     162            return rc;
     163        memcpy(&aTimespecs[0], pAccessTime ? pAccessTime : &ObjInfo.AccessTime, sizeof(struct timespec));
     164        memcpy(&aTimespecs[1], pModificationTime ? pModificationTime : &ObjInfo.ModificationTime, sizeof(struct timespec));
     165    }
     166
     167    if (futimens(RTFileToNative(hFile), aTimespecs))
     168    {
     169        int rc = RTErrConvertFromErrno(errno);
     170        Log(("RTFileSetTimes(%RTfile,%p,%p,,): returns %Rrc\n", hFile, pAccessTime, pModificationTime, rc));
     171        return rc;
     172    }
     173#else
    146174    /*
    147175     * Convert the input to timeval, getting the missing one if necessary,
     
    172200        return rc;
    173201    }
     202#endif
    174203    return VINF_SUCCESS;
    175204}
  • trunk/src/VBox/Runtime/r3/posix/filelock-posix.cpp

    r37596 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3434#include <sys/types.h>
    3535#include <sys/ioctl.h>
    36 #include <sys/fcntl.h>
    3736#include <fcntl.h>
    3837#include <unistd.h>
  • trunk/src/VBox/Runtime/r3/posix/fs2-posix.cpp

    r34015 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3434#ifndef DEV_BSIZE
    3535# include <sys/stat.h>
     36# if defined(RT_OS_HAIKU) && !defined(S_BLKSIZE)
     37#  define S_BLKSIZE 512
     38# endif
    3639# define DEV_BSIZE S_BLKSIZE /** @todo bird: add DEV_BSIZE to sys/param.h on OS/2. */
    3740#endif
  • trunk/src/VBox/Runtime/r3/posix/rand-posix.cpp

    r37596 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3333#include <sys/types.h>
    3434#include <sys/ioctl.h>
    35 #include <sys/fcntl.h>
    3635#include <fcntl.h>
    3736#ifdef _MSC_VER
  • trunk/src/VBox/Runtime/r3/posix/semevent-posix.cpp

    r39032 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4949#endif
    5050
    51 #ifdef RT_OS_SOLARIS
     51#if defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU)
    5252# include <sched.h>
    5353# define pthread_yield() sched_yield()
     
    398398         */
    399399        struct timespec     ts = {0,0};
    400 #ifdef RT_OS_DARWIN
     400#if defined(RT_OS_DARWIN) || defined(RT_OS_HAIKU)
    401401        struct timeval      tv = {0,0};
    402402        gettimeofday(&tv, NULL);
  • trunk/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp

    r40103 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    482482    if (!pThis->fMonotonicClock)
    483483    {
    484 #ifdef RT_OS_DARWIN
     484#if defined(RT_OS_DARWIN) || defined(RT_OS_HAIKU)
    485485        struct timeval  tv = {0,0};
    486486        gettimeofday(&tv, NULL);
  • trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp

    r28800 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    250250         */
    251251        struct timespec     ts = {0,0};
     252#ifdef RT_OS_HAIKU
     253        struct timeval      tv = {0,0};
     254        gettimeofday(&tv, NULL);
     255        ts.tv_sec = tv.tv_sec;
     256        ts.tv_nsec = tv.tv_usec * 1000;
     257#else
    252258        clock_gettime(CLOCK_REALTIME, &ts);
     259#endif
    253260        if (cMillies != 0)
    254261        {
  • trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp

    r41881 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5252# define IPRT_MAY_HAVE_PTHREAD_SET_NAME_NP
    5353# include <dlfcn.h>
     54#endif
     55#if defined(RT_OS_HAIKU)
     56# include <OS.h>
    5457#endif
    5558
     
    413416
    414417    return VINF_SUCCESS;
     418#elif defined(RT_OS_HAIKU)
     419    thread_info       ThreadInfo;
     420    status_t status = get_thread_info(find_thread(NULL), &ThreadInfo);
     421    AssertReturn(status == B_OK, RTErrConvertFromErrno(status));
     422
     423    *pKernelTime = ThreadInfo.kernel_time / 1000;
     424    *pUserTime   = ThreadInfo.user_time / 1000;
     425
     426    return VINF_SUCCESS;
    415427#else
    416428    return VERR_NOT_IMPLEMENTED;
  • trunk/src/VBox/Runtime/r3/posix/thread2-posix.cpp

    r39443 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6363#elif defined(RT_OS_FREEBSD) /* void pthread_yield */
    6464        pthread_yield();
    65 #elif defined(RT_OS_SOLARIS)
     65#elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU)
    6666        sched_yield();
    6767#else
     
    102102#elif defined(RT_OS_FREEBSD) /* void pthread_yield */
    103103        pthread_yield();
    104 #elif defined(RT_OS_SOLARIS)
     104#elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU)
    105105        sched_yield();
    106106#else
     
    131131#ifdef RT_OS_DARWIN
    132132    pthread_yield_np();
    133 #elif defined(RT_OS_SOLARIS)
     133#elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU)
    134134    sched_yield();
    135135#else
  • trunk/src/VBox/Runtime/r3/posix/utf8-posix.cpp

    r40654 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    194194            const void *pvInputLeft = pvInput;
    195195            void       *pvOutputLeft = pvOutput;
    196 #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
     196#if defined(RT_OS_LINUX) || defined(RT_OS_HAIKU) || defined(RT_OS_SOLARIS) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
    197197            if (iconv(hIconv, (char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1)
    198198#else
     
    320320            const void *pvInputLeft = pvInput;
    321321            void       *pvOutputLeft = pvOutput;
    322 #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
     322#if defined(RT_OS_LINUX) || defined(RT_OS_HAIKU) || defined(RT_OS_SOLARIS) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
    323323            if (iconv(icHandle, (char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1)
    324324#else
  • trunk/src/VBox/Runtime/r3/socket.cpp

    r43213 r43363  
    3434#else /* !RT_OS_WINDOWS */
    3535# include <errno.h>
     36# include <sys/select.h>
    3637# include <sys/stat.h>
    3738# include <sys/socket.h>
Note: See TracChangeset for help on using the changeset viewer.

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