rtProcInitExePath-linux.cpp revision 95bbd60a323feec1eaf008a93690364eea86c298
af062818b47340eef15700d2f0211576ba3506eevboxsync * IPRT - rtProcInitName, Linux.
af062818b47340eef15700d2f0211576ba3506eevboxsync * Copyright (C) 2006-2008 Oracle Corporation
af062818b47340eef15700d2f0211576ba3506eevboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
af062818b47340eef15700d2f0211576ba3506eevboxsync * available from http://www.virtualbox.org. This file is free software;
af062818b47340eef15700d2f0211576ba3506eevboxsync * you can redistribute it and/or modify it under the terms of the GNU
af062818b47340eef15700d2f0211576ba3506eevboxsync * General Public License (GPL) as published by the Free Software
af062818b47340eef15700d2f0211576ba3506eevboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
af062818b47340eef15700d2f0211576ba3506eevboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
af062818b47340eef15700d2f0211576ba3506eevboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
af062818b47340eef15700d2f0211576ba3506eevboxsync * The contents of this file may alternatively be used under the terms
af062818b47340eef15700d2f0211576ba3506eevboxsync * of the Common Development and Distribution License Version 1.0
af062818b47340eef15700d2f0211576ba3506eevboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * VirtualBox OSE distribution, in which case the provisions of the
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * CDDL are applicable instead of those of the GPL.
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * You may elect to license modified versions of this file under the
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * terms and conditions of either the GPL or the CDDL or both.
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync/*******************************************************************************
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync* Header Files *
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync*******************************************************************************/
af062818b47340eef15700d2f0211576ba3506eevboxsyncDECLHIDDEN(int) rtProcInitExePath(char *pszPath, size_t cchPath)
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync * Read the /proc/self/exe link, convert to native and return it.
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync int cchLink = readlink("/proc/self/exe", pszPath, cchPath - 1);
af062818b47340eef15700d2f0211576ba3506eevboxsync char const *pszTmp;
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync AssertMsgRCReturn(rc, ("rc=%Rrc pszLink=\"%s\"\nhex: %.*Rhsx\n", rc, pszPath, cchLink, pszPath), rc);
return rc;
return rc;