os/ossrv/genericopenlibs/openenvcore/libc/src/getpid.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 *
    16 */
    17 
    18 // Deal with getpid() and related functions
    19 
    20 
    21 #include <e32std.h>
    22 #include <stdlib.h>
    23 #include <unistd.h>
    24 
    25 
    26 
    27 extern "C" {
    28 
    29 pid_t _getpid ()
    30 	{
    31 	RProcess p;
    32 	TProcessId i=p.Id();
    33 	return *REINTERPRET_CAST(TUint*,&i);
    34 	}
    35 
    36 
    37 EXPORT_C pid_t getpid ()
    38 	{
    39 	return _getpid() ;
    40 	
    41 	}
    42 
    43 } // extern "C"
    44 
    45 
    46