thread-posix.cpp revision c7e66b48bdf7951be785fd684c85915bf11c292f
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste * IPRT - Threads, POSIX.
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste * Copyright (C) 2006-2012 Oracle Corporation
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste * This file is part of VirtualBox Open Source Edition (OSE), as
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste * available from http://www.virtualbox.org. This file is free software;
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste * you can redistribute it and/or modify it under the terms of the GNU
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste * General Public License (GPL) as published by the Free Software
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste * Foundation, in version 2 as it comes in the "COPYING" file of the
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
aa3a2aee90d1c61946a08c839d9838be7658b453Craig McDonnell * The contents of this file may alternatively be used under the terms
aa3a2aee90d1c61946a08c839d9838be7658b453Craig McDonnell * of the Common Development and Distribution License Version 1.0
aa3a2aee90d1c61946a08c839d9838be7658b453Craig McDonnell * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
aa3a2aee90d1c61946a08c839d9838be7658b453Craig McDonnell * VirtualBox OSE distribution, in which case the provisions of the
aa3a2aee90d1c61946a08c839d9838be7658b453Craig McDonnell * CDDL are applicable instead of those of the GPL.
aa3a2aee90d1c61946a08c839d9838be7658b453Craig McDonnell * You may elect to license modified versions of this file under the
aa3a2aee90d1c61946a08c839d9838be7658b453Craig McDonnell * terms and conditions of either the GPL or the CDDL or both.
aa3a2aee90d1c61946a08c839d9838be7658b453Craig McDonnell/*******************************************************************************
aa3a2aee90d1c61946a08c839d9838be7658b453Craig McDonnell* Header Files *
aa3a2aee90d1c61946a08c839d9838be7658b453Craig McDonnell*******************************************************************************/
a94c54cb089c9aa0943767ea3e458e8110036a55Craig McDonnell#if defined(RT_OS_DARWIN) /*|| defined(RT_OS_FREEBSD) - later */ \
a94c54cb089c9aa0943767ea3e458e8110036a55Craig McDonnell || (defined(RT_OS_LINUX) && !defined(IN_RT_STATIC) /* static + dlsym = trouble */) \
a94c54cb089c9aa0943767ea3e458e8110036a55Craig McDonnell || defined(IPRT_MAY_HAVE_PTHREAD_SET_NAME_NP)
#ifndef IN_GUEST
# define RTTHREAD_POSIX_WITH_POKE
#ifdef RTTHREAD_POSIX_WITH_POKE
# if defined(RT_OS_DARWIN)
* @returns errno.h
* @returns errno.h
if (rc)
return VERR_NO_TLS_FOR_SELF;
#ifdef RTTHREAD_POSIX_WITH_POKE
static const int s_aiSigCandidates[] =
# ifdef SIGRTMAX
# ifndef RT_OS_SOLARIS
return rc;
#ifdef RTTHREAD_POSIX_WITH_POKE
* Block SIGALRM - required for timer-posix.cpp.
#ifdef RTTHREAD_POSIX_WITH_POKE
if (!rc)
return VINF_SUCCESS;
return VERR_FAILED_TO_SET_SELF_TLS;
#if defined(RT_OS_LINUX)
* Block SIGALRM - required for timer-posix.cpp.
#ifdef RTTHREAD_POSIX_WITH_POKE
if (g_pfnThreadSetName)
# ifdef RT_OS_DARWIN
#ifdef RT_OS_LINUX
if (!rc)
if (!rc)
if (!rc)
if (!rc)
return VINF_SUCCESS;
return pThread;
#ifdef RTTHREAD_POSIX_WITH_POKE
int rc;
return rc;
#if defined(RT_OS_SOLARIS)
if (rc)
return VINF_SUCCESS;
if (rc)
*pKernelTime = 0;
return VINF_SUCCESS;
kern_return_t krc = thread_info(mach_thread_self(), THREAD_BASIC_INFO, (thread_info_t)&ThreadInfo, &Count);
return VINF_SUCCESS;
return VINF_SUCCESS;
return VERR_NOT_IMPLEMENTED;